1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 A representation of an adjustable bounded value
7 <!-- ##### SECTION Long_Description ##### -->
9 The #GtkAdjustment object represents a value which has an associated lower
10 and upper bound, together with step and page increments, and a page size.
11 It is used within several GTK+ widgets, including
12 #GtkSpinButton, #GtkViewport, and #GtkRange (which is a base class for
13 #GtkHScrollbar, #GtkVScrollbar, #GtkHScale, and #GtkVScale).
16 The #GtkAdjustment object does not update the value itself. Instead
17 it is left up to the owner of the #GtkAdjustment to control the value.
20 The owner of the #GtkAdjustment typically calls the
21 gtk_adjustment_value_changed() and gtk_adjustment_changed() functions
22 after changing the value and its bounds. This results in the emission of the
23 "value_changed" or "changed" signal respectively.
26 <!-- ##### SECTION See_Also ##### -->
31 <!-- ##### SECTION Stability_Level ##### -->
34 <!-- ##### SECTION Image ##### -->
37 <!-- ##### STRUCT GtkAdjustment ##### -->
39 The #GtkAdjustment-struct struct contains the following fields.
41 <informaltable pgwide="1" frame="none" role="struct">
42 <tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
46 <entry>#gdouble lower;</entry>
47 <entry>the minimum value.</entry>
51 <entry>#gdouble upper;</entry>
52 <entry>the maximum value.</entry>
56 <entry>#gdouble value;</entry>
57 <entry>the current value.</entry>
61 <entry>#gdouble step_increment;</entry>
62 <entry>the increment to use to make minor changes to the value.
63 In a #GtkScrollbar this increment is used when the mouse is clicked on the
64 arrows at the top and bottom of the scrollbar, to scroll by a small amount.
69 <entry>#gdouble page_increment;</entry>
70 <entry>the increment to use to make major changes to the value.
71 In a #GtkScrollbar this increment is used when the mouse is clicked in the
72 trough, to scroll by a large amount.
77 <entry>#gdouble page_size;</entry>
79 In a #GtkScrollbar this is the size of the area which is currently visible.
83 </tbody></tgroup></informaltable>
88 <!-- ##### SIGNAL GtkAdjustment::changed ##### -->
90 Emitted when one or more of the #GtkAdjustment fields have been changed,
91 other than the value field.
94 @adjustment: the object which received the signal.
96 <!-- ##### SIGNAL GtkAdjustment::value-changed ##### -->
98 Emitted when the #GtkAdjustment value field has been changed.
101 @adjustment: the object which received the signal.
103 <!-- ##### ARG GtkAdjustment:lower ##### -->
108 <!-- ##### ARG GtkAdjustment:page-increment ##### -->
113 <!-- ##### ARG GtkAdjustment:page-size ##### -->
118 <!-- ##### ARG GtkAdjustment:step-increment ##### -->
123 <!-- ##### ARG GtkAdjustment:upper ##### -->
128 <!-- ##### ARG GtkAdjustment:value ##### -->
133 <!-- ##### FUNCTION gtk_adjustment_new ##### -->
135 Creates a new #GtkAdjustment.
138 @value: the initial value.
139 @lower: the minimum value.
140 @upper: the maximum value.
141 @step_increment: the step increment.
142 @page_increment: the page increment.
143 @page_size: the page size.
144 @Returns: a new #GtkAdjustment.
147 <!-- ##### FUNCTION gtk_adjustment_get_value ##### -->
156 <!-- ##### FUNCTION gtk_adjustment_set_value ##### -->
158 Sets the #GtkAdjustment value. The value is clamped to lie between
159 <literal>adjustment->lower</literal> and
160 <literal>adjustment->upper</literal>.
163 Note that for adjustments which are used in a #GtkScrollbar, the effective
164 range of allowed values goes from <literal>adjustment->lower</literal> to
165 <literal>adjustment->upper - adjustment->page_size</literal>.
168 @adjustment: a #GtkAdjustment.
169 @value: the new value.
172 <!-- ##### FUNCTION gtk_adjustment_clamp_page ##### -->
174 Updates the #GtkAdjustment @value to ensure that the range between @lower
175 and @upper is in the current page (i.e. between @value and @value +
177 If the range is larger than the page size, then only the start of it will
178 be in the current page.
179 A "changed" signal will be emitted if the value is changed.
182 @adjustment: a #GtkAdjustment.
183 @lower: the lower value.
184 @upper: the upper value.
187 <!-- ##### FUNCTION gtk_adjustment_changed ##### -->
189 Emits a "changed" signal from the #GtkAdjustment.
190 This is typically called by the owner of the #GtkAdjustment after it has
191 changed any of the #GtkAdjustment fields other than the value.
194 @adjustment: a #GtkAdjustment
197 <!-- ##### FUNCTION gtk_adjustment_value_changed ##### -->
199 Emits a "value_changed" signal from the #GtkAdjustment.
200 This is typically called by the owner of the #GtkAdjustment after it has
201 changed the #GtkAdjustment value field.
204 @adjustment: a #GtkAdjustment
207 <!-- ##### FUNCTION gtk_adjustment_configure ##### -->
221 <!-- ##### FUNCTION gtk_adjustment_get_lower ##### -->
230 <!-- ##### FUNCTION gtk_adjustment_get_page_increment ##### -->
239 <!-- ##### FUNCTION gtk_adjustment_get_page_size ##### -->
248 <!-- ##### FUNCTION gtk_adjustment_get_step_increment ##### -->
257 <!-- ##### FUNCTION gtk_adjustment_get_upper ##### -->
266 <!-- ##### FUNCTION gtk_adjustment_set_lower ##### -->
275 <!-- ##### FUNCTION gtk_adjustment_set_page_increment ##### -->
284 <!-- ##### FUNCTION gtk_adjustment_set_page_size ##### -->
293 <!-- ##### FUNCTION gtk_adjustment_set_step_increment ##### -->
302 <!-- ##### FUNCTION gtk_adjustment_set_upper ##### -->