9.3.2 Getting and Setting Adjustments

Getting and setting the adjustment for a range widget "on the fly" is done, predictable, with:

# Returns the adjustment
Gtk::Range#adjustment

# Sytax sugar, both set the adjusment
Gtk::Range#set_adjustment( adjustment )
Gtk::Range#adjustment=( adjustment )

Both #set_adjustment and #adjustment= will do absolutely nothing if you pass it the adjustment that that the Gtk::Range is already using, regardless of whether you changed any of its fields or not. If you pass it a new Adjustment, it will unreference the old one if it exists (possibly destroying it), connect the appropriate signals to the new one, and recalculate the size and.or position of the slider and redraw if necessary.


Prev Next