> I want it to display always the 
> lowest part of the widget inside it (a gtk.textview)

I found this to be more difficult that it looked.

The way that I did it for a scrolling text window is to set a Mark at 
the end of the buffer like this:

        self.endMark = self.msgBuffer.create_mark (
            "end", self.msgBuffer.get_end_iter(), gtk.FALSE)

Then (after every text addition), I tell it to scroll to the end, like 
this:

        self.msgPanel.scroll_to_mark (self.endMark, 0.05,
                                      gtk.TRUE, 0.0, 1.0)

The Mark will "do the right thing" about where it is in the buffer and 
how the idle task works.

How not to do it: "scroll_to_iter" looks like it will do the right 
thing, but there is a odd timing issue.  The new size of the text 
window won't be computed until all the drawing is done (it's an idle 
task).  However, "get_end_iter" and "scroll_to_iter", happen 
immediately.  So you would tend to scroll near the end, but not quite 
to it (very frustrating).

Hope this helps,
-Dan
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to