Next: , Previous: GtkPaned, Up: Top

134 GtkRange

Base class for widgets which visualize an adjustment

134.1 Overview

134.2 Usage

— Class: <gtk-range>

Derives from <gtk-widget>.

This class defines the following slots:

How the range should be updated on the screen
The GtkAdjustment that contains the current value of this range object
Invert direction slider moves to increase range value
The sensitivity policy for the stepper that points to the adjustment's lower side
The sensitivity policy for the stepper that points to the adjustment's upper side
Whether to display a fill level indicator graphics on trough.
Whether to restrict the upper boundary to the fill level.
The fill level.
— Signal on <gtk-range>: value-changed

Emitted when the range value changes.

— Signal on <gtk-range>: adjust-bounds (arg0 <gdouble>)
— Signal on <gtk-range>: move-slider (arg0 <gtk-scroll-type>)

Virtual function that moves the slider. Used for keybindings.

— Signal on <gtk-range>: change-value (arg0 <gtk-scroll-type>) (arg1 <gdouble>) ⇒ <gboolean>

The ::change-value signal is emitted when a scroll action is performed on a range. It allows an application to determine the type of scroll event that occurred and the resultant new value. The application can handle the event itself and return ‘#t’ to prevent further processing. Or, by returning ‘#f’, it can pass the event to other handlers until the default GTK+ handler is reached.

The value parameter is unrounded. An application that overrides the ::change-value signal is responsible for clamping the value to the desired number of decimal digits; the default GTK+ handler clamps the value based on range->round-digits.

It is not possible to use delayed update policies in an overridden ::change-value handler.

Since 2.6

— Function: gtk-range-get-adjustment (self <gtk-range>) ⇒  (ret <gtk-adjustment>)
— Method: get-adjustment

Get the <gtk-adjustment> which is the "model" object for <gtk-range>. See gtk-range-set-adjustment for details. The return value does not have a reference added, so should not be unreferenced.

a <gtk-range>
a <gtk-adjustment>
— Function: gtk-range-set-update-policy (self <gtk-range>) (policy <gtk-update-type>)
— Method: set-update-policy

Sets the update policy for the range. <gtk-update-continuous> means that anytime the range slider is moved, the range value will change and the value_changed signal will be emitted. <gtk-update-delayed> means that the value will be updated after a brief timeout where no slider motion occurs, so updates are spaced by a short time rather than continuous. <gtk-update-discontinuous> means that the value will only be updated when the user releases the button and ends the slider drag operation.

a <gtk-range>
update policy
— Function: gtk-range-set-adjustment (self <gtk-range>) (adjustment <gtk-adjustment>)
— Method: set-adjustment

Sets the adjustment to be used as the "model" object for this range widget. The adjustment indicates the current range value, the minimum and maximum range values, the step/page increments used for keybindings and scrolling, and the page size. The page size is normally 0 for <gtk-scale> and nonzero for <gtk-scrollbar>, and indicates the size of the visible area of the widget being scrolled. The page size affects the size of the scrollbar slider.

a <gtk-range>
a <gtk-adjustment>
— Function: gtk-range-get-inverted (self <gtk-range>) ⇒  (ret bool)
— Method: get-inverted

Gets the value set by gtk-range-set-inverted.

a <gtk-range>
#t’ if the range is inverted
— Function: gtk-range-set-inverted (self <gtk-range>) (setting bool)
— Method: set-inverted

Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right. Inverted ranges have higher values at the top or on the right rather than on the bottom or left.

a <gtk-range>
#t’ to invert the range
— Function: gtk-range-get-update-policy (self <gtk-range>) ⇒  (ret <gtk-update-type>)
— Method: get-update-policy

Gets the update policy of range. See gtk-range-set-update-policy.

a <gtk-range>
the current update policy
— Function: gtk-range-get-value (self <gtk-range>) ⇒  (ret double)
— Method: get-value

Gets the current value of the range.

a <gtk-range>
current value of the range.
— Function: gtk-range-set-increments (self <gtk-range>) (step double) (page double)
— Method: set-increments

Sets the step and page sizes for the range. The step size is used when the user clicks the <gtk-scrollbar> arrows or moves <gtk-scale> via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.

a <gtk-range>
step size
page size
— Function: gtk-range-set-range (self <gtk-range>) (min double) (max double)
— Method: set-range

Sets the allowable values in the <gtk-range>, and clamps the range value to be between min and max. (If the range has a non-zero page size, it is clamped between min and max - page-size.)

a <gtk-range>
minimum range value
maximum range value
— Function: gtk-range-set-value (self <gtk-range>) (value double)
— Method: set-value

Sets the current value of the range; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them. The range emits the "value_changed" signal if the value changes.

a <gtk-range>
new value of the range