1.6 <GtkAdjustment>

Class: <GtkAdjustment>

It derives from <GInitiallyUnowned>.

A model for a numeric value.

The <GtkAdjustment> has an associated lower and upper bound. It also contains step and page increments, and a page size.

Adjustments are used within several GTK widgets, including <GtkSpinButton>, <GtkViewport>, <GtkScrollbar> and <GtkScale>.

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

Fields

parent-instance

Properties

Property: adjustment:lower self

The minimum value of the adjustment.

Its value is a real number.

Set it with (set! (adjustment:lower self) value).

Property: adjustment:page-increment self

The page increment of the adjustment.

Its value is a real number.

Set it with (set! (adjustment:page-increment self) value).

Property: adjustment:page-size self

The page size of the adjustment.

Note that the page-size is irrelevant and should be set to zero if the adjustment is used for a simple scalar value, e.g. in a <GtkSpinButton>.

Its value is a real number.

Set it with (set! (adjustment:page-size self) value).

Property: adjustment:step-increment self

The step increment of the adjustment.

Its value is a real number.

Set it with (set! (adjustment:step-increment self) value).

Property: adjustment:upper self

The maximum value of the adjustment.

Note that values will be restricted by upper - page-size if the page-size property is nonzero.

Its value is a real number.

Set it with (set! (adjustment:upper self) value).

Property: adjustment:value self

The value of the adjustment.

Its value is a real number.

Set it with (set! (adjustment:value self) value).

Procedures

Method: adjustment:clamp-page self lower upper
Method: clamp-page self lower upper

Updates the value of the adjustment to ensure that the given range is contained in the current page.

The current page goes from value to 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 adjustment:value-changed signal will be emitted if the value is changed.

self

Passed: a <GtkAdjustment>.

an adjustment

lower

Passed: a real number.

the lower value

upper

Passed: a real number.

the upper value

Method: adjustment:configure self value lower upper step-increment page-increment page-size
Method: configure self value lower upper step-increment page-increment page-size

Sets all properties of the adjustment at once.

Use this function to avoid multiple emissions of the adjustment:changed signal. See adjustment:set-lower for an alternative way of compressing multiple emissions of adjustment:changed into one.

self

Passed: a <GtkAdjustment>.

an adjustment

value

Passed: a real number.

the new value

lower

Passed: a real number.

the new minimum value

upper

Passed: a real number.

the new maximum value

step-increment

Passed: a real number.

the new step increment

page-increment

Passed: a real number.

the new page increment

page-size

Passed: a real number.

the new page size

Method: adjustment:get-lower self ⇒ %return
Method: get-lower self ⇒ %return

Retrieves the minimum value of the adjustment.

self

Passed: a <GtkAdjustment>.

an adjustment

%return

Returned: a real number.

the minimum value

Method: adjustment:get-minimum-increment self ⇒ %return
Method: get-minimum-increment self ⇒ %return

Gets the smaller of step increment and page increment.

self

Passed: a <GtkAdjustment>.

an adjustment

%return

Returned: a real number.

the minimum increment

Method: adjustment:get-page-increment self ⇒ %return
Method: get-page-increment self ⇒ %return

Retrieves the page increment of the adjustment.

self

Passed: a <GtkAdjustment>.

an adjustment

%return

Returned: a real number.

the page increment

Method: adjustment:get-page-size self ⇒ %return
Method: get-page-size self ⇒ %return

Retrieves the page size of the adjustment.

self

Passed: a <GtkAdjustment>.

an adjustment

%return

Returned: a real number.

the page size

Method: adjustment:get-step-increment self ⇒ %return
Method: get-step-increment self ⇒ %return

Retrieves the step increment of the adjustment.

self

Passed: a <GtkAdjustment>.

an adjustment

%return

Returned: a real number.

the step increment

Method: adjustment:get-upper self ⇒ %return
Method: get-upper self ⇒ %return

Retrieves the maximum value of the adjustment.

self

Passed: a <GtkAdjustment>.

an adjustment

%return

Returned: a real number.

the maximum value

Method: adjustment:get-value self ⇒ %return
Method: get-value self ⇒ %return

Gets the current value of the adjustment.

self

Passed: a <GtkAdjustment>.

an adjustment

%return

Returned: a real number.

the current value

Procedure: adjustment:new value lower upper step-increment page-increment page-size ⇒ %return

Creates a new <GtkAdjustment>.

value

Passed: a real number.

the initial value

lower

Passed: a real number.

the minimum value

upper

Passed: a real number.

the maximum value

step-increment

Passed: a real number.

the step increment

page-increment

Passed: a real number.

the page increment

page-size

Passed: a real number.

the page size

%return

Returned: a <GtkAdjustment>.

a new <GtkAdjustment>

Method: adjustment:set-lower self lower
Method: set-lower self lower

Sets the minimum value of the adjustment.

When setting multiple adjustment properties via their individual setters, multiple adjustment:changed signals will be emitted. However, since the emission of the adjustment:changed signal is tied to the emission of the ::notify signals of the changed properties, it’s possible to compress the adjustment:changed signals into one by calling object:freeze-notify and object:thaw-notify around the calls to the individual setters.

Alternatively, using a single g_object_set() for all the properties to change, or using adjustment:configure has the same effect.

self

Passed: a <GtkAdjustment>.

an adjustment

lower

Passed: a real number.

the new minimum value

Method: adjustment:set-page-increment self page-increment
Method: set-page-increment self page-increment

Sets the page increment of the adjustment.

See adjustment:set-lower about how to compress multiple emissions of the adjustment:changed signal when setting multiple adjustment properties.

self

Passed: a <GtkAdjustment>.

an adjustment

page-increment

Passed: a real number.

the new page increment

Method: adjustment:set-page-size self page-size
Method: set-page-size self page-size

Sets the page size of the adjustment.

See adjustment:set-lower about how to compress multiple emissions of the adjustment:changed signal when setting multiple adjustment properties.

self

Passed: a <GtkAdjustment>.

an adjustment

page-size

Passed: a real number.

the new page size

Method: adjustment:set-step-increment self step-increment
Method: set-step-increment self step-increment

Sets the step increment of the adjustment.

See adjustment:set-lower about how to compress multiple emissions of the adjustment:changed signal when setting multiple adjustment properties.

self

Passed: a <GtkAdjustment>.

an adjustment

step-increment

Passed: a real number.

the new step increment

Method: adjustment:set-upper self upper
Method: set-upper self upper

Sets the maximum value of the adjustment.

Note that values will be restricted by upper - page-size if the page-size property is nonzero.

See adjustment:set-lower about how to compress multiple emissions of the adjustment:changed signal when setting multiple adjustment properties.

self

Passed: a <GtkAdjustment>.

an adjustment

upper

Passed: a real number.

the new maximum value

Method: adjustment:set-value self value
Method: set-value self value

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.

self

Passed: a <GtkAdjustment>.

an adjustment

value

Passed: a real number.

the new value

Signals

Signal: adjustment:changed

Connect a handler with (connect object adjustment:changed handler). It is called as (handler self).

Emitted when one or more of the <GtkAdjustment> properties have been changed.

Note that the adjustment:value property is covered by the adjustment:value-changed signal.

self

Passed: a <GtkAdjustment>.

Signal: adjustment:value-changed

Connect a handler with (connect object adjustment:value-changed handler). It is called as (handler self).

Emitted when the value has been changed.

self

Passed: a <GtkAdjustment>.

Virtual methods

Virtual method: adjustment:do-changed implementor self

To override it in a new class, give register-type #:vfuncs `((changed . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <GtkAdjustment>, or a class that derives from it, or its GType number.

self

Passed: a <GtkAdjustment>.

Virtual method: adjustment:do-value-changed implementor self

To override it in a new class, give register-type #:vfuncs `((value-changed . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <GtkAdjustment>, or a class that derives from it, or its GType number.

self

Passed: a <GtkAdjustment>.