[pygtk] Updating scrolled windows

reidar reidar.hagen at gmail.com
Fri Jun 23 08:35:56 WST 2006

Probably not the most insightfull reply, but using a TreeView and catching  
the 'row-changed' on the underlying tree-model and subsequently using  
TreeView.scroll_to_cell(path) is working nicely on our logger-display. I  
think we had trouble with trying to scroll *before* the scroll-bar had had  
time to update itself though, presumably something similar may be  
happening in your code.


our code, GPL'ed:

On Fri, 23 Jun 2006 02:09:35 +0200, N. French <nbm_clan at yahoo.com> wrote:

> I have a gtk.ScrolledWindow that I use as an interactive console (I
> take entry from a gtk.Entry and display the results in a gtk.TextView
> housed in a gtk.ScrolledWindow).  Below is my function to write the
> text to the buffer and set the ScrolledWindow's scroll bar to the end.
> I want it to behave like an xterm would, new text appears at the bottom
> and you scroll upwards to see old stuff.
> This basically works.  My problem is it doesn't quite scroll the window
> all the way to the bottom, it's always short by one line.
> Any suggestions?
> Thanks,
> Nathan French
> --
> def dump_text(self, text):
>     """The interface into the scrolling command history window."""
>     #sys.stderr.write( '** %s' % text)
>     i = self.dump.get_iter_at_offset(-1)
>     self.dump.insert(i, text)
>     self.dumpscroll.emit('scroll-child', gtk.SCROLL_END, False) # this
> doesn't work right
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

More information about the pygtk mailing list