1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
GtkAdjustment
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2002-11-29 23:08:54 +00:00
|
|
|
A GtkObject representing an adjustable bounded value
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
|
|
|
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).
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The #GtkAdjustment object does not update the value itself. Instead
|
|
|
|
it is left up to the owner of the #GtkAdjustment to control the value.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
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.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2005-06-10 04:24:30 +00:00
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### STRUCT GtkAdjustment ##### -->
|
|
|
|
<para>
|
|
|
|
The #GtkAdjustment-struct struct contains the following fields.
|
|
|
|
|
2002-05-28 22:23:55 +00:00
|
|
|
<informaltable pgwide="1" frame="none" role="struct">
|
|
|
|
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
|
1999-08-16 18:51:52 +00:00
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<row>
|
2001-10-28 22:11:10 +00:00
|
|
|
<entry>#gdouble lower;</entry>
|
1999-08-16 18:51:52 +00:00
|
|
|
<entry>the minimum value.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2001-10-28 22:11:10 +00:00
|
|
|
<entry>#gdouble upper;</entry>
|
1999-08-16 18:51:52 +00:00
|
|
|
<entry>the maximum value.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2001-10-28 22:11:10 +00:00
|
|
|
<entry>#gdouble value;</entry>
|
1999-08-16 18:51:52 +00:00
|
|
|
<entry>the current value.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2001-10-28 22:11:10 +00:00
|
|
|
<entry>#gdouble step_increment;</entry>
|
1999-08-16 18:51:52 +00:00
|
|
|
<entry>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.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2001-10-28 22:11:10 +00:00
|
|
|
<entry>#gdouble page_increment;</entry>
|
1999-08-16 18:51:52 +00:00
|
|
|
<entry>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.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2001-10-28 22:11:10 +00:00
|
|
|
<entry>#gdouble page_size;</entry>
|
1999-08-16 18:51:52 +00:00
|
|
|
<entry>the page size.
|
|
|
|
In a #GtkScrollbar this is the size of the area which is currently visible.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody></tgroup></informaltable>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
2004-07-20 02:26:06 +00:00
|
|
|
<!-- ##### SIGNAL GtkAdjustment::changed ##### -->
|
|
|
|
<para>
|
|
|
|
Emitted when one or more of the #GtkAdjustment fields have been changed,
|
|
|
|
other than the value field.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment: the object which received the signal.
|
|
|
|
|
|
|
|
<!-- ##### SIGNAL GtkAdjustment::value-changed ##### -->
|
|
|
|
<para>
|
|
|
|
Emitted when the #GtkAdjustment value field has been changed.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment: the object which received the signal.
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkAdjustment:lower ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkAdjustment:page-increment ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkAdjustment:page-size ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkAdjustment:step-increment ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkAdjustment:upper ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ARG GtkAdjustment:value ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gtk_adjustment_new ##### -->
|
|
|
|
<para>
|
|
|
|
Creates a new #GtkAdjustment.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@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.
|
|
|
|
|
|
|
|
|
2001-10-13 05:52:14 +00:00
|
|
|
<!-- ##### FUNCTION gtk_adjustment_get_value ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gtk_adjustment_set_value ##### -->
|
|
|
|
<para>
|
2003-05-26 22:58:28 +00:00
|
|
|
Sets the #GtkAdjustment value. The value is clamped to lie between
|
|
|
|
<literal>adjustment->lower</literal> and
|
|
|
|
<literal>adjustment->upper</literal>.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Note that for adjustments which are used in a #GtkScrollbar, the effective
|
|
|
|
range of allowed values goes from <literal>adjustment->lower</literal> to
|
|
|
|
<literal>adjustment->upper - adjustment->page_size</literal>.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment: a #GtkAdjustment.
|
|
|
|
@value: the new value.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_clamp_page ##### -->
|
|
|
|
<para>
|
|
|
|
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.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment: a #GtkAdjustment.
|
|
|
|
@lower: the lower value.
|
|
|
|
@upper: the upper value.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_changed ##### -->
|
|
|
|
<para>
|
|
|
|
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.
|
|
|
|
</para>
|
|
|
|
|
2005-06-10 04:24:30 +00:00
|
|
|
@adjustment: a #GtkAdjustment
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_value_changed ##### -->
|
|
|
|
<para>
|
2001-11-14 22:36:23 +00:00
|
|
|
Emits a "value_changed" signal from the #GtkAdjustment.
|
1999-08-16 18:51:52 +00:00
|
|
|
This is typically called by the owner of the #GtkAdjustment after it has
|
|
|
|
changed the #GtkAdjustment value field.
|
|
|
|
</para>
|
|
|
|
|
2005-06-10 04:24:30 +00:00
|
|
|
@adjustment: a #GtkAdjustment
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2008-08-19 01:17:29 +00:00
|
|
|
<!-- ##### FUNCTION gtk_adjustment_configure ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@value:
|
|
|
|
@lower:
|
|
|
|
@upper:
|
|
|
|
@step_increment:
|
|
|
|
@page_increment:
|
|
|
|
@page_size:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_get_lower ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_get_page_increment ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_get_page_size ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_get_step_increment ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_get_upper ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_set_lower ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@lower:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_set_page_increment ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@page_increment:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_set_page_size ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@page_size:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_set_step_increment ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@step_increment:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_adjustment_set_upper ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@adjustment:
|
|
|
|
@upper:
|
|
|
|
|
|
|
|
|