Gtk.Range¶
- Subclasses:
Methods¶
- Inherited:
Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
The |
||
r/w/en |
The fill level. |
||
r/w/en |
Invert direction slider moves to increase range value |
||
d/r/w/en |
The sensitivity policy for the stepper that points to the adjustment’s lower side |
||
r/w/en |
Whether to restrict the upper boundary to the fill level. |
||
r/w/en |
The number of digits to round the value to. |
||
r/w/en |
Whether to display a fill level indicator graphics on trough. |
||
d/r/w/en |
The sensitivity policy for the stepper that points to the adjustment’s upper side |
Style Properties¶
- Inherited:
Name |
Type |
Default |
Flags |
Short Description |
---|---|---|---|---|
|
|
d/r |
How far in the x direction to move the arrow when the button is depressed |
|
|
|
d/r |
How far in the y direction to move the arrow when the button is depressed |
|
|
|
d/r |
Arrow scaling with regard to scroll button size |
|
|
|
d/r |
Width of scrollbar or scale thumb |
|
|
|
d/r |
Length of step buttons at ends |
|
|
|
d/r |
Spacing between step buttons and thumb |
|
|
|
d/r |
Spacing between thumb/steppers and outer trough bevel |
|
|
d/r |
Whether to draw trough for full length of range or exclude the steppers and spacing |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted before clamping a value, to give the application a chance to adjust the bounds. |
|
The |
|
Virtual function that moves the slider. |
|
Emitted when the range value changes. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
widget |
r |
Class Details¶
- class Gtk.Range(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Gtk.Range
is the common base class for widgets which visualize an adjustment, e.gGtk.Scale
orGtk.Scrollbar
.Apart from signals for monitoring the parameters of the adjustment,
Gtk.Range
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. SeeGtk.Range.set_fill_level
().- get_adjustment()[source]¶
- Returns:
- Return type:
Get the
Gtk.Adjustment
which is the “model” object forGtk.Range
. SeeGtk.Range.set_adjustment
() for details. The return value does not have a reference added, so should not be unreferenced.
- get_fill_level()[source]¶
- Returns:
The current fill level
- Return type:
Gets the current position of the fill level indicator.
New in version 2.12.
- get_flippable()[source]¶
-
Gets the value set by
Gtk.Range.set_flippable
().New in version 2.18.
- get_inverted()[source]¶
-
Gets the value set by
Gtk.Range.set_inverted
().
- get_lower_stepper_sensitivity()[source]¶
- Returns:
The lower stepper’s sensitivity policy.
- Return type:
Gets the sensitivity policy for the stepper that points to the ‘lower’ end of the
Gtk.Range
’s adjustment.New in version 2.10.
- get_min_slider_size()[source]¶
- Returns:
The minimum size of the range’s slider.
- Return type:
This function is useful mainly for
Gtk.Range
subclasses.See
Gtk.Range.set_min_slider_size
().New in version 2.20.
Deprecated since version 3.20: Use the min-height/min-width CSS properties on the slider node.
- get_range_rect()[source]¶
- Returns:
return location for the range rectangle
- Return type:
range_rect:
Gdk.Rectangle
This function returns the area that contains the range’s trough and its steppers, in widget->window coordinates.
This function is useful mainly for
Gtk.Range
subclasses.New in version 2.20.
- get_restrict_to_fill_level()[source]¶
-
Gets whether the range is restricted to the fill level.
New in version 2.12.
- get_round_digits()[source]¶
- Returns:
the number of digits to round to
- Return type:
Gets the number of digits to round the value to when it changes. See
Gtk.Range
::change-value
.New in version 2.24.
- get_show_fill_level()[source]¶
-
Gets whether the range displays the fill level graphically.
New in version 2.12.
- get_slider_range()[source]¶
- Returns:
- Return type:
This function returns sliders range along the long dimension, in widget->window coordinates.
This function is useful mainly for
Gtk.Range
subclasses.New in version 2.20.
- get_slider_size_fixed()[source]¶
- Returns:
whether the range’s slider has a fixed size.
- Return type:
This function is useful mainly for
Gtk.Range
subclasses.See
Gtk.Range.set_slider_size_fixed
().New in version 2.20.
- get_upper_stepper_sensitivity()[source]¶
- Returns:
The upper stepper’s sensitivity policy.
- Return type:
Gets the sensitivity policy for the stepper that points to the ‘upper’ end of the
Gtk.Range
’s adjustment.New in version 2.10.
- get_value()[source]¶
- Returns:
current value of the range.
- Return type:
Gets the current value of the range.
- set_adjustment(adjustment)[source]¶
- Parameters:
adjustment (
Gtk.Adjustment
) – aGtk.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 forGtk.Scrollbar
, and indicates the size of the visible area of the widget being scrolled. The page size affects the size of the scrollbar slider.
- set_fill_level(fill_level)[source]¶
- Parameters:
fill_level (
float
) – the new position of the fill level indicator
Set 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.New in version 2.12.
- set_flippable(flippable)[source]¶
-
If a range is flippable, it will switch its direction if it is horizontal and its direction is
Gtk.TextDirection.RTL
.See
Gtk.Widget.get_direction
().New in version 2.18.
- set_increments(step, page)[source]¶
-
Sets the step and page sizes for the range. The step size is used when the user clicks the
Gtk.Scrollbar
arrows or movesGtk.Scale
via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.
- set_inverted(setting)[source]¶
-
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.
- set_lower_stepper_sensitivity(sensitivity)[source]¶
- Parameters:
sensitivity (
Gtk.SensitivityType
) – the lower stepper’s sensitivity policy.
Sets the sensitivity policy for the stepper that points to the ‘lower’ end of the
Gtk.Range
’s adjustment.New in version 2.10.
- set_min_slider_size(min_size)[source]¶
- Parameters:
min_size (
int
) – The slider’s minimum size
Sets the minimum size of the range’s slider.
This function is useful mainly for
Gtk.Range
subclasses.New in version 2.20.
Deprecated since version 3.20: Use the min-height/min-width CSS properties on the slider node.
- set_range(min, max)[source]¶
-
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.)
- set_restrict_to_fill_level(restrict_to_fill_level)[source]¶
- Parameters:
restrict_to_fill_level (
bool
) – Whether the fill level restricts slider movement.
Sets whether the slider is restricted to the fill level. See
Gtk.Range.set_fill_level
() for a general description of the fill level concept.New in version 2.12.
- set_round_digits(round_digits)[source]¶
- Parameters:
round_digits (
int
) – the precision in digits, or -1
Sets the number of digits to round the value to when it changes. See
Gtk.Range
::change-value
.New in version 2.24.
- set_show_fill_level(show_fill_level)[source]¶
- Parameters:
show_fill_level (
bool
) – Whether a fill level indicator graphics is shown.
Sets whether a graphical fill level is show on the trough. See
Gtk.Range.set_fill_level
() for a general description of the fill level concept.New in version 2.12.
- set_slider_size_fixed(size_fixed)[source]¶
-
Sets whether the range’s slider has a fixed size, or a size that depends on its adjustment’s page size.
This function is useful mainly for
Gtk.Range
subclasses.New in version 2.20.
- set_upper_stepper_sensitivity(sensitivity)[source]¶
- Parameters:
sensitivity (
Gtk.SensitivityType
) – the upper stepper’s sensitivity policy.
Sets the sensitivity policy for the stepper that points to the ‘upper’ end of the
Gtk.Range
’s adjustment.New in version 2.10.
- set_value(value)[source]¶
- Parameters:
value (
float
) – new value of the range
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
Gtk.Range
::value-changed
signal if the value changes.
- do_change_value(scroll, new_value) virtual¶
- Parameters:
scroll (
Gtk.ScrollType
) –new_value (
float
) –
- Return type:
- do_get_range_border(border_) virtual¶
- Parameters:
border (
Gtk.Border
) –
- do_get_range_size_request(orientation, minimum, natural) virtual¶
- Parameters:
orientation (
Gtk.Orientation
) –minimum (
int
) –natural (
int
) –
- do_move_slider(scroll) virtual¶
- Parameters:
scroll (
Gtk.ScrollType
) –
- do_value_changed() virtual¶
Signal Details¶
- Gtk.Range.signals.adjust_bounds(range, value)¶
- Signal Name:
adjust-bounds
- Flags:
- Parameters:
Emitted before clamping a value, to give the application a chance to adjust the bounds.
- Gtk.Range.signals.change_value(range, scroll, value)¶
- Signal Name:
change-value
- Flags:
- Parameters:
range (
Gtk.Range
) – The object which received the signalscroll (
Gtk.ScrollType
) – the type of scroll action that was performedvalue (
float
) – the new value resulting from the scroll action
- Returns:
True
to prevent other handlers from being invoked for the signal,False
to propagate the signal further- Return type:
The
Gtk.Range
::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 returnTrue
to prevent further processing. Or, by returningFalse
, 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
Gtk.Range
::change-value
signal is responsible for clamping the value to the desired number of decimal digits; the default GTK+ handler clamps the value based onGtk.Range
:round-digits
.New in version 2.6.
- Gtk.Range.signals.move_slider(range, step)¶
- Signal Name:
move-slider
- Flags:
- Parameters:
range (
Gtk.Range
) – The object which received the signalstep (
Gtk.ScrollType
) – how to move the slider
Virtual function that moves the slider. Used for keybindings.
Property Details¶
- Gtk.Range.props.adjustment¶
- Name:
adjustment
- Type:
- Default Value:
- Flags:
The
Gtk.Adjustment
that contains the current value of this range object
- Gtk.Range.props.fill_level¶
- Name:
fill-level
- Type:
- Default Value:
1.7976931348623157e+308
- Flags:
The fill level (e.g. prebuffering of a network stream). See
Gtk.Range.set_fill_level
().New in version 2.12.
- Gtk.Range.props.inverted¶
- Name:
inverted
- Type:
- Default Value:
- Flags:
Invert direction slider moves to increase range value
- Gtk.Range.props.lower_stepper_sensitivity¶
- Name:
lower-stepper-sensitivity
- Type:
- Default Value:
- Flags:
The sensitivity policy for the stepper that points to the adjustment’s lower side
Deprecated since version ???.
- Gtk.Range.props.restrict_to_fill_level¶
- Name:
restrict-to-fill-level
- Type:
- Default Value:
- Flags:
The restrict-to-fill-level property controls whether slider movement is restricted to an upper boundary set by the fill level. See
Gtk.Range.set_restrict_to_fill_level
().New in version 2.12.
- Gtk.Range.props.round_digits¶
- Name:
round-digits
- Type:
- Default Value:
-1
- Flags:
The number of digits to round the value to when it changes, or -1. See
Gtk.Range
::change-value
.New in version 2.24.
- Gtk.Range.props.show_fill_level¶
- Name:
show-fill-level
- Type:
- Default Value:
- Flags:
The show-fill-level property controls whether fill level indicator graphics are displayed on the trough. See
Gtk.Range.set_show_fill_level
().New in version 2.12.
- Gtk.Range.props.upper_stepper_sensitivity¶
- Name:
upper-stepper-sensitivity
- Type:
- Default Value:
- Flags:
The sensitivity policy for the stepper that points to the adjustment’s upper side
Deprecated since version ???.