Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GTK Scrolled Window - scroll to the bottom

I'm writing an app using GTK+, and I have a problem. I'm using GTK Scrolled Window and I must scroll the vertical scrollbar to the bottom, but I don't know, how. I was looking in Google, but I found nothing.

like image 823
m4tx Avatar asked Dec 18 '10 16:12

m4tx


2 Answers

You must get the adjustment object (hadjustment, vadjustment), and then call methods on them. Assuming gtkmm, since you tagged this with c++, something like this:

Glib::RefPtr<Adjustment> adj = win->get_vadjustment();
adj->set_value(adj->get_upper()); 
like image 57
ergosys Avatar answered Oct 29 '22 23:10

ergosys


Gtk without Glib would be some feat. :)

Make sure you can build and run this: Scrolling Example

like image 3
Billy O'Connor Avatar answered Oct 29 '22 21:10

Billy O'Connor