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:

update-policy
How the range should be updated on the screen
adjustment
The GtkAdjustment that contains the current value of this range object
inverted
Invert direction slider moves to increase range value
lower-stepper-sensitivity
The sensitivity policy for the stepper that points to the adjustment's lower side
upper-stepper-sensitivity
The sensitivity policy for the stepper that points to the adjustment's upper side
show-fill-level
Whether to display a fill level indicator graphics on trough.
restrict-to-fill-level
Whether to restrict the upper boundary to the fill level.
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.

range
a <gtk-range>
ret
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.

range
a <gtk-range>
policy
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.

range
a <gtk-range>
adjustment
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.

range
a <gtk-range>
ret
#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.

range
a <gtk-range>
setting
#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.

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

Gets the current value of the range.

range
a <gtk-range>
ret
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.

range
a <gtk-range>
step
step size
page
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.)

range
a <gtk-range>
min
minimum range value
max
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.

range
a <gtk-range>
value
new value of the range