11.26Class GtkAdjustment

A GtkObject representing an adjustable bounded value

Class GtkAdjustment( [value],[lower],[upper],[step_increment],[page_increment],[page_size] )
value the current value.
lower the minimum value.
upper the maximum value.
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.
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.
page_size the page size. In a GtkScrollbar this is the size of the area which is currently visible.

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.

Methods
changedEmits a "changed" signal from the GtkAdjustment.
clamp_pageUpdates 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).
configureSets all properties of the adjustment at once.
get_lowerRetrieves the minimum value of the adjustment.
get_page_incrementRetrieves the page increment of the adjustment.
get_page_sizeRetrieves the page size of the adjustment.
get_step_incrementRetrieves the step increment of the adjustment.
get_upperRetrieves the maximum value of the adjustment.
get_valueGets the current value of the adjustment.
set_lowerSets the minimum value of the adjustment.
set_page_incrementSets the page increment of the adjustment.
set_page_sizeSets the page size of the adjustment.
set_step_incrementSets the step increment of the adjustment.
set_upperSets the maximum value of the adjustment.
set_valueSets the GtkAdjustment value.
signal_changedEmitted when one or more of the GtkAdjustment fields have been changed, other than the value field.
signal_value_changedEmitted when the GtkAdjustment value field has been changed.
value_changedEmits a "value_changed" signal from the GtkAdjustment.

Methods

changed

Emits a "changed" signal from the GtkAdjustment.

GtkAdjustment.changed()

This is typically called by the owner of the GtkAdjustment after it has changed any of the GtkAdjustment fields other than the value.

clamp_page

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).

GtkAdjustment.clamp_page( lower, upper )
lower the lower value
upper the upper value

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.

configure

Sets all properties of the adjustment at once.

GtkAdjustment.configure( value, lower, upper, step_increment, page_increment, page_size )
value the new value.
lower the new minimum value.
upper the new maximum value.
step_increment the step increment.
page_increment the page increment.
page_size the page size.

Use this function to avoid multiple emissions of the "changed" signal. See gtk_adjustment_set_lower() for an alternative way of compressing multiple emissions of "changed" into one.

get_lower

Retrieves the minimum value of the adjustment.

GtkAdjustment.get_lower()
ReturnThe current minimum value of the adjustment.

get_page_increment

Retrieves the page increment of the adjustment.

GtkAdjustment.get_page_increment()
ReturnThe current page increment of the adjustment.

get_page_size

Retrieves the page size of the adjustment.

GtkAdjustment.get_page_size()
ReturnThe current page size of the adjustment.

get_step_increment

Retrieves the step increment of the adjustment.

GtkAdjustment.get_step_increment()
ReturnThe current step increment of the adjustment.

get_upper

Retrieves the maximum value of the adjustment.

GtkAdjustment.get_upper()
ReturnThe current maximum value of the adjustment.

get_value

Gets the current value of the adjustment.

GtkAdjustment.get_value()
ReturnThe current value of the adjustment.

set_lower

Sets the minimum value of the adjustment.

GtkAdjustment.set_lower( lower )
lower the new minimum value

When setting multiple adjustment properties via their individual setters, multiple "changed" signals will be emitted. However, since the emission of the "changed" signal is tied to the emission of the "GObject::notify" signals of the changed properties, it's possible to compress the "changed" signals into one by calling g_object_freeze_notify() and g_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 gtk_adjustment_configure() has the same effect of compressing "changed" emissions.

set_page_increment

Sets the page increment of the adjustment.

GtkAdjustment.set_page_increment( page_increment )
page_increment the new page increment

See gtk_adjustment_set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.

set_page_size

Sets the page size of the adjustment.

GtkAdjustment.set_page_size( page_size )
page_size the new page size

See gtk_adjustment_set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.

set_step_increment

Sets the step increment of the adjustment.

GtkAdjustment.set_step_increment( step_increment )
step_increment the new step increment

See gtk_adjustment_set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.

set_upper

Sets the maximum value of the adjustment.

GtkAdjustment.set_upper()

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

See gtk_adjustment_set_lower() about how to compress multiple emissions of the "changed" signal when setting multiple adjustment properties.

set_value

Sets the GtkAdjustment value.

GtkAdjustment.set_value( value )
value the new 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.

signal_changed

Emitted when one or more of the GtkAdjustment fields have been changed, other than the value field.

GtkAdjustment.signal_changed()

signal_value_changed

Emitted when the GtkAdjustment value field has been changed.

GtkAdjustment.signal_value_changed()

value_changed

Emits a "value_changed" signal from the GtkAdjustment.

GtkAdjustment.value_changed()

This is typically called by the owner of the GtkAdjustment after it has changed the GtkAdjustment value field.

Made with http://www.falconpl.org