Base class for widgets which visualize an adjustment
Class GtkRange
GtkRange is the common base class for widgets which visualize an adjustment, e.g scales or scrollbars.
Apart from signals for monitoring the parameters of the adjustment, GtkRange provides properties and methods for influencing the sensitivity of the "steppers". It also provides properties and methods for setting a "fill level" on range widgets. See gtk_range_set_fill_level().
Methods | |
get_adjustment | Get the GtkAdjustment which is the "model" object for GtkRange. |
get_fill_level | Gets the current position of the fill level indicator. |
get_flippable | Gets the value set by gtk_range_set_flippable(). |
get_inverted | Gets the value set by gtk_range_set_inverted(). |
get_lower_stepper_sensitivity | Gets the sensitivity policy for the stepper that points to the 'lower' end of the GtkRange's adjustment. |
get_min_slider_size | This function is useful mainly for GtkRange subclasses. |
get_range_rect | This function returns the area that contains the range's trough and its steppers, in widget->window coordinates. |
get_restrict_to_fill_level | Gets whether the range is restricted to the fill level. |
get_show_fill_level | Gets whether the range displays the fill level graphically. |
get_slider_range | This function returns sliders range along the long dimension, in widget->window coordinates. |
get_slider_size_fixed | This function is useful mainly for GtkRange subclasses. |
get_update_policy | Gets the update policy of range. |
get_upper_stepper_sensitivity | Gets the sensitivity policy for the stepper that points to the 'upper' end of the GtkRange's adjustment. |
get_value | Gets the current value of the range. |
set_adjustment | Sets the adjustment to be used as the "model" object for this range widget. |
set_fill_level | Set the new position of the fill level indicator. |
set_flippable | If a range is flippable, it will switch its direction if it is horizontal and its direction is GTK_TEXT_DIR_RTL. |
set_increments | Sets the step and page sizes for the range. |
set_inverted | Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right. |
set_lower_stepper_sensitivity | Sets the sensitivity policy for the stepper that points to the 'lower' end of the GtkRange's adjustment. |
set_min_slider_size | Sets the minimum size of the range's slider. |
set_range | Sets the allowable values in the GtkRange, and clamps the range value to be between min and max. |
set_restrict_to_fill_level | Sets whether the slider is restricted to the fill level. |
set_show_fill_level | Sets whether a graphical fill level is show on the trough. |
set_slider_size_fixed | Sets whether the range's slider has a fixed size, or a size that depends on it's adjustment's page size. |
set_update_policy | Sets the update policy for the range. |
set_upper_stepper_sensitivity | Sets the sensitivity policy for the stepper that points to the 'upper' end of the GtkRange's adjustment. |
set_value | Sets the current value of the range |
signal_adjust_bounds | The "adjust-bounds" signal is emitted when the range is adjusted by user action. |
signal_change_value | The change-value signal is emitted when a scroll action is performed on a range. |
signal_move_slider | Virtual function that moves the slider. Used for keybindings. |
value_changed | Emitted when the range value changes. |
Get the GtkAdjustment which is the "model" object for GtkRange.
GtkRange.get_adjustment()
Return | a GtkAdjustment |
Gets the current position of the fill level indicator.
GtkRange.get_fill_level()
Return | The current fill level |
Gets the value set by gtk_range_set_flippable().
GtkRange.get_flippable()
Return | TRUE if the range is flippable |
Gets the value set by gtk_range_set_inverted().
GtkRange.get_inverted()
Return | TRUE if the range is inverted |
Gets the sensitivity policy for the stepper that points to the 'lower' end of the GtkRange's adjustment.
GtkRange.get_lower_stepper_sensitivity()
Return | The lower stepper's sensitivity policy. |
This function is useful mainly for GtkRange subclasses.
GtkRange.get_min_slider_size()
Return | The minimum size of the range's slider. |
This function returns the area that contains the range's trough and its steppers, in widget->window coordinates.
GtkRange.get_range_rect()
Return | the range rectangle (GdkRectangle). |
This function is useful mainly for GtkRange subclasses.
Gets whether the range is restricted to the fill level.
GtkRange.get_restrict_to_fill_level()
Return | TRUE if range is restricted to the fill level. |
Gets whether the range displays the fill level graphically.
GtkRange.get_show_fill_level()
Return | TRUE if range shows the fill level. |
This function returns sliders range along the long dimension, in widget->window coordinates.
GtkRange.get_slider_range()
Return | Array [ slider start, slider end ] |
This function is useful mainly for GtkRange subclasses.
This function is useful mainly for GtkRange subclasses.
GtkRange.get_slider_size_fixed()
Return | whether the range's slider has a fixed size. |
Gets the update policy of range.
GtkRange.get_update_policy()
Return | The current update policy (GtkUpdateType). |
Gets the sensitivity policy for the stepper that points to the 'upper' end of the GtkRange's adjustment.
GtkRange.get_upper_stepper_sensitivity()
Return | The upper stepper's sensitivity policy. |
Gets the current value of the range.
GtkRange.get_value()
Return | current value of the range. |
Sets the adjustment to be used as the "model" object for this range widget.
GtkRange.set_adjustment( adjustment )
adjustment | a GtkAdjustment |
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 GtkScale and nonzero for GtkScrollbar, and indicates the size of the visible area of the widget being scrolled. The page size affects the size of the scrollbar slider.
Set the new position of the fill level indicator.
GtkRange.set_fill_level( fill_level )
fill_level | the new position of the fill level indicator |
The "fill level" is probably best described by its most prominent use case, which is an indicator for the amount of pre-buffering in a streaming media player. In that use case, the value of the range would indicate the current play position, and the fill level would be the position up to which the file/stream has been downloaded.
This amount of prebuffering can be displayed on the range's trough and is themeable separately from the trough. To enable fill level display, use gtk_range_set_show_fill_level(). The range defaults to not showing the fill level.
Additionally, it's possible to restrict the range's slider position to values which are smaller than the fill level. This is controller by gtk_range_set_restrict_to_fill_level() and is by default enabled.
If a range is flippable, it will switch its direction if it is horizontal and its direction is GTK_TEXT_DIR_RTL.
GtkRange.set_flippable( flippable )
flippable | TRUE to make the range flippable |
Sets the step and page sizes for the range.
GtkRange.set_increments( step, page )
step | step size |
page | page size |
The step size is used when the user clicks the GtkScrollbar arrows or moves GtkScale via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.
Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right.
GtkRange.set_inverted( setting )
setting | TRUE to invert the range |
Inverted ranges have higher values at the top or on the right rather than on the bottom or left.
Sets the sensitivity policy for the stepper that points to the 'lower' end of the GtkRange's adjustment.
GtkRange.set_lower_stepper_sensitivity( sensitivity )
sensitivity | the lower stepper's sensitivity policy (GtkSensitivityType). |
Sets the minimum size of the range's slider.
GtkRange.set_min_slider_size( min_size )
min_size | The slider's minimum size |
This function is useful mainly for GtkRange subclasses.
Sets the allowable values in the GtkRange, and clamps the range value to be between min and max.
GtkRange.set_range( min, max )
min | minimum range value |
max | maximum range value |
If the range has a non-zero page size, it is clamped between min and max - page-size.
Sets whether the slider is restricted to the fill level.
GtkRange.set_restrict_to_fill_level( restrict_to_fill_level )
restrict_to_fill_level | Whether the fill level restricts slider movement. |
Sets whether a graphical fill level is show on the trough.
GtkRange.set_show_fill_level( show_fill_level )
show_fill_level | Whether a fill level indicator graphics is shown. |
Sets whether the range's slider has a fixed size, or a size that depends on it's adjustment's page size.
GtkRange.set_slider_size_fixed( size_fixed )
size_fixed | TRUE to make the slider size constant |
This function is useful mainly for GtkRange subclasses.
Sets the update policy for the range.
GtkRange.set_update_policy( policy )
policy | update policy (GtkUpdateType). |
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.
Sets the sensitivity policy for the stepper that points to the 'upper' end of the GtkRange's adjustment.
GtkRange.set_upper_stepper_sensitivity( sensitivity )
sensitivity | the upper stepper's sensitivity policy. |
Sets the current value of the range
GtkRange.set_value( value )
value | new 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.
The "adjust-bounds" signal is emitted when the range is adjusted by user action.
GtkRange.signal_adjust_bounds()
Note the value can be more or less than the range since it depends on the mouse position.
The change-value signal is emitted when a scroll action is performed on a range.
GtkRange.signal_change_value()
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 TRUE to prevent further processing. Or, by returning FALSE, 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.
Virtual function that moves the slider. Used for keybindings.
GtkRange.signal_move_slider()
Emitted when the range value changes.
GtkRange.value_changed()