GtkAdjustment
A GtkObject representing an adjustable bounded value
The #GtkAdjustment object represents a value which has an associated lower
and upper bound, together with step and page increments, and a page size.
It is used within several GTK+ widgets, including
#GtkSpinButton, #GtkViewport, and #GtkRange (which is a base class for
#GtkHScrollbar, #GtkVScrollbar, #GtkHScale, and #GtkVScale).
The #GtkAdjustment object does not update the value itself. Instead
it is left up to the owner of the #GtkAdjustment to control the value.
The owner of the #GtkAdjustment typically calls the
gtk_adjustment_value_changed() and gtk_adjustment_changed() functions
after changing the value and its bounds. This results in the emission of the
"value_changed" or "changed" signal respectively.
The #GtkAdjustment-struct struct contains the following fields.
#gdouble lower;
the minimum value.
#gdouble upper;
the maximum value.
#gdouble value;
the current value.
#gdouble step_increment;
the increment to use to make minor changes to the value.
In a #GtkScrollbar this increment is used when the mouse is clicked on the
arrows at the top and bottom of the scrollbar, to scroll by a small amount.
#gdouble page_increment;
the increment to use to make major changes to the value.
In a #GtkScrollbar this increment is used when the mouse is clicked in the
trough, to scroll by a large amount.
#gdouble page_size;
the page size.
In a #GtkScrollbar this is the size of the area which is currently visible.
Creates a new #GtkAdjustment.
@value: the initial value.
@lower: the minimum value.
@upper: the maximum value.
@step_increment: the step increment.
@page_increment: the page increment.
@page_size: the page size.
@Returns: a new #GtkAdjustment.
@adjustment:
@Returns:
Sets the #GtkAdjustment value. The value is clamped to lie between
adjustment->lower and
adjustment->upper.
Note that for adjustments which are used in a #GtkScrollbar, the effective
range of allowed values goes from adjustment->lower to
adjustment->upper - adjustment->page_size.
@adjustment: a #GtkAdjustment.
@value: the new value.
Updates the #GtkAdjustment @value to ensure that the range between @lower
and @upper is in the current page (i.e. between @value and @value +
@page_size).
If the range is larger than the page size, then only the start of it will
be in the current page.
A "changed" signal will be emitted if the value is changed.
@adjustment: a #GtkAdjustment.
@lower: the lower value.
@upper: the upper value.
Emits a "changed" signal from the #GtkAdjustment.
This is typically called by the owner of the #GtkAdjustment after it has
changed any of the #GtkAdjustment fields other than the value.
@adjustment:
Emits a "value_changed" signal from the #GtkAdjustment.
This is typically called by the owner of the #GtkAdjustment after it has
changed the #GtkAdjustment value field.
@adjustment:
Emitted when one or more of the #GtkAdjustment fields have been changed,
other than the value field.
@adjustment: the object which received the signal.
Emitted when the #GtkAdjustment value field has been changed.
@adjustment: the object which received the signal.