[ gtk+-1.2.6, pygtk-0.6.4, python-1.5.2 ]

I create a text widget, and attach a vertical scrollbar.
I insert a lot of text.  Now I want to programmaticaly position
the scrollbar at the end, i.e. with the last line of text at the
visible bottom of the window.  How is this done?

vbox.pack_start(GtkLabel('Machine Log'), FALSE, FALSE)
text = GtkText()
text.set_editable(FALSE)
text.set_word_wrap(TRUE)
textbox=GtkHBox()
textbox.pack_start(text, TRUE, TRUE, 0)
textbox.pack_start(GtkVScrollbar(text.get_vadjustment()), FALSE, FALSE, 0)
vbox.pack_start(textbox, TRUE, TRUE)

text.delete_text(0, -1)
text.freeze()
for ldate,lstatus,lusr,lcomment in rslt:
    text.insert_defaults('Date: ' + ldate + '  User: ' + lusr + '  Status: ' + lstatus 
+ '\n')
    text.insert_defaults(lcomment + '\n')
    text.insert_defaults('___________________________\n')
text.thaw()

#Now 'text' is positioned at the top; how do I set it to the bottom.
#I looked for something like set_scroll_pos(pos), but couldn't find such.

Any other comments about good (or terrible) style, easier/better ways to 
do things like this are welcome...

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to