Peter Johanson wrote:
> On Mon, Feb 11, 2008 at 06:49:34PM +0100, Carl Bernardi wrote:
>> Does any one know how to set the scrollbar position. I am able to get
>> the scrollbar and all it's ancestors but I am not sure how to
>> programmatically change the position of the scrollbar. In my case I
>> would like it to be right at the bottom.
> You should be able to use Gtk::Range.value= or
> Gtk::Range.adjustment.value to set it. You can see the upper and lower
> limits by using Gtk::Range.adjustment.upper or .lower.
Thanks for the answer but that is what I tried. It only moved the
scrollbar part way as so.
Before setting the value of Gtk::Range.
Gtk::Adjustment.upper returned 255.
After calling this line of code.
Gtk::Range.value = Gtk::Adjustment.upper
Gtk::Adjustment.upper returned 15.
I just found the answer and it was pretty clear when I gave it some
thought. To move the scrollbar all the way to the other side(or bottom)
use Gtk::ScrolledWindow.hscrollbar/vscrollbar.adjustment.inverted =
true. Since the scrollbar starts at 0 and this setting will make the
oppostie end of the scrollbar 0, it will move the slider to the
end/bottom. I also noticed that anytime text is appended the scrollbar
will stay at the end/bottom.
Thanks for the help,
Posted via http://www.ruby-forum.com/.