Next: , Previous: GtkPaperSize, Up: Top


114 GtkAdjustment

A GtkObject representing an adjustable bounded value

114.1 Overview

The <gtk-adjustment> 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 <gtk-spin-button>, <gtk-viewport>, and <gtk-range> (which is a base class for <gtk-hscrollbar>, <gtk-vscrollbar>, <gtk-hscale>, and <gtk-vscale>).

The <gtk-adjustment> object does not update the value itself. Instead it is left up to the owner of the <gtk-adjustment> to control the value.

The owner of the <gtk-adjustment> 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.

114.2 Usage

— Class: <gtk-adjustment>

Derives from <gtk-object>.

This class defines the following slots:

value
The value of the adjustment
lower
The minimum value of the adjustment
upper
The maximum value of the adjustment
step-increment
The step increment of the adjustment
page-increment
The page increment of the adjustment
page-size
The page size of the adjustment
— Signal on <gtk-adjustment>: changed

Emitted when one or more of the <gtk-adjustment> fields have been changed, other than the value field.

— Signal on <gtk-adjustment>: value-changed

Emitted when the <gtk-adjustment> value field has been changed.

— Function: gtk-adjustment-new (value double) (lower double) (upper double) (step_increment double) (page_increment double) (page_size double) ⇒  (ret <gtk-object>)

Creates a new <gtk-adjustment>.

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.
ret
a new <gtk-adjustment>.
— Function: gtk-adjustment-get-value (self <gtk-adjustment>) ⇒  (ret double)
— Method: get-value

Gets the current value of the adjustment. See gtk-adjustment-set-value.

adjustment
a <gtk-adjustment>
ret
The current value of the adjustment.
— Function: gtk-adjustment-set-value (self <gtk-adjustment>) (value double)
— Method: set-value

Sets the <gtk-adjustment> value. The value is clamped to lie between ‘adjustment->lower’ and ‘adjustment->upper’.

Note that for adjustments which are used in a <gtk-scrollbar>, the effective range of allowed values goes from ‘adjustment->lower’ to ‘adjustment->upper - adjustment->page_size’.

adjustment
a <gtk-adjustment>.
value
the new value.
— Function: gtk-adjustment-clamp-page (self <gtk-adjustment>) (lower double) (upper double)
— Method: clamp-page

Updates the <gtk-adjustment>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 <gtk-adjustment>.
lower
the lower value.
upper
the upper value.
— Function: gtk-adjustment-changed (self <gtk-adjustment>)
— Method: changed

Emits a "changed" signal from the <gtk-adjustment>. This is typically called by the owner of the <gtk-adjustment> after it has changed any of the <gtk-adjustment> fields other than the value.

adjustment
a <gtk-adjustment>
— Function: gtk-adjustment-value-changed (self <gtk-adjustment>)
— Method: value-changed

Emits a "value_changed" signal from the <gtk-adjustment>. This is typically called by the owner of the <gtk-adjustment> after it has changed the <gtk-adjustment> value field.

adjustment
a <gtk-adjustment>