Re: Scroll to bottom of window...
- Date: Tue, 22 Apr 2008 11:34:21 +0300
- From: "Kalle Vahlman" <kalle.vahlman@xxxxxxxxx>
- Subject: Re: Scroll to bottom of window...
2008/4/22, David Conley (FRD) <dconley@xxxxxxxxx>:
> I'm trying to write a app that has a small text window that fills with
> text from another thread. Its all working fine but the text is dropping
> off the end of the window. Really what I'd like is for the scroll window
> the text view is in to automatically scroll to the bottom to show the
> latest message added. I suspect I need to use
> gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW(scroll), adj);
> but what I set my adjustment to I have no idea. Anyone got any tips.
What you rather want to do is to _get_ the vadjustment (which is a
GtkAdjustment object) and set it's value to the upper bound of it
(which translates to "the scrollbar to the end position"). Something
like this:
vadj = gtk_scrolled_window_get_vadjustment(swin);
gtk_adjustment_set_value(vadj, vadj->upper);
Depending on the widget you use, there might be even better ways to do
this, but this should work if you always just want to go to the end.
--
Kalle Vahlman, zuh@xxxxxx
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-devel-list