On Sun, 2005-27-03 at 08:51 -0500, Saurabh Wagh wrote: > Hey there , > > As posted in a different query, i ve been able to achieve printing the > contents of a list on a textview, one string on a line. > > I am facing another problem. The list that i get is at runtime , from > the server ( as a result of xmlrpc call ) and i am displaying the > contents of the list on a textview using the code : ( variable name > for list is "result" ) > > for text in result: > textbuffer.insert_at_cursor(text+'/n') > > I ve got to make hyperlink for each item ( which points to a different > link ) so i had to use tags for each item. Now, since each link is > different, i ve to identify each click as a distinct click and, > ideally, the code for that could have been : > > iter1 = textbuffer.get_start_iter() > iter2 = textbuffer.get_start_iter() > > for text in result: > textbuffer.insert_at_cursor(text) > iter2.forward_word_end() > textbuffer.apply_tag(tag,iter1,iter2) > iter2 = iter1.forward_line() > iter1 = iter2.copy() > > However this code gives me an error as iters are invalidated if buffer > is modified. I however have to give tags in the same loop as i put > things on buffer as i need to get their identity while making the > links. > > Could this be achieved. I ve tried Text Marks but the tags to be > applied cant take marks as parameters but only iters. > > Can any one help me out with this problem ? > > -- Saurabh
Take a look at summary.py in our code. It handles multiple url's mouse motion, highlighting, etc.. http://cvs.sourceforge.net/viewcvs.py/*checkout*/porthole/porthole/summary.py?rev=1.21 -- Brian <[EMAIL PROTECTED]> _______________________________________________ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/