[pygtk] Updating scrolled windows

N. French nbm_clan at yahoo.com
Fri Jun 23 08:09:35 WST 2006


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 


More information about the pygtk mailing list