Am Do, 2003-11-27 um 14.24 schrieb Christian Robottom Reis: > On Thu, Nov 27, 2003 at 01:38:29PM +0100, Felix Benner wrote: > > Hi, I'm using a TextView as a telnet terminal and want to scroll the > > view when new output arrives. I use the following code fragment > > Quick question: have you had a look at > http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq14.010.htp
I tried this, but it doesn't work. Neither self.output.scroll_to_iter(self.output.get_buffer().get_end_iter(), 0) nor self.output.scroll_to_mark(self.output.get_buffer().get_insert(), 0) actually scroll the window. Did I maybe set up something wrong? I just added the TextView to a ScrolledWindow. Do I need to connect some signals? > > I Also encounter the problem that clicking in the TextView sets the > > insert mark although the text is neither editable nor the cursor is > > shown. Maybe I have to catch the button_pressed signal there? > > Do you actually need the insert mark? I assume you could just do > > end_iter = text_buffer.get_end_iter() > text_buffer.insert(end_iter, text) > > every time you have something to output. I was using the insert mark because I want to add ansi sequences so text is not necessarily added at the end of the buffer. But I could store the cursorposition and get an iter for inserting. I only consider using the insert mark as better style. Thank you for the quick answer. -- Felix Benner Tel. +49 (0)711 720 7900 Fanny-Leicht-Stra�e 14 Mobil +49 (0)177 339 4145 D-70563 Stuttgart mailto:[EMAIL PROTECTED] _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
