gtk.Rangea base class for widgets that allow a user to set a value in
a range.Synopsisgtk.Rangegtk.Widgetset_update_policypolicyget_update_policyset_adjustmentadjustmentget_adjustmentset_invertedsettingget_invertedset_incrementssteppageset_rangeminmaxset_valuevalueget_valueget_fill_levelset_fill_levelfill_levelget_restrict_to_fill_levelset_restrict_to_fill_levelrestrict_to_fill_levelget_show_fill_levelset_show_fill_levelshow_fill_levelset_round_digitsround_digitsget_round_digitsset_min_slider_sizemin_sizeget_min_slider_sizeget_range_rectset_slider_size_fixedsize_fixedget_slider_size_fixedset_flippableflippableget_flippableset_lower_stepper_sensitivitysensitivityget_lower_stepper_sensitivityset_upper_stepper_sensitivitysensitivityget_upper_stepper_sensitivityAncestry+-- gobject.GObject
+-- gtk.Object
+-- gtk.Widget
+-- gtk.Range
Implemented Interfacesgtk.Range
implements
gtk.Buildablegtk.Range Propertiesgtk.Object Propertiesgtk.Widget Properties
"adjustment"Read-WriteThe gtk.Adjustment
that contains the current value of this range object"fill-level"Read-WriteThe fill level (e.g. prebuffering of a network stream).
See gtk.Range.set_fill_level().
Default value: 1.79769e+308. Available in GTK+ 2.12."inverted"Read-WriteIf True, the slider movement is
reversed e.g right-to-left instead of left-to-right"lower-stepper-sensitivity"Read-WriteThe sensitivity policy for the stepper that points to the
adjustment's lower side.
Default value: gtk.SENSITIVITY_AUTO"restrict-to-fill-level"Read-WriteThe restrict-to-fill-level property controls whether slider movement is restricted to
an upper boundary set by the fill level. See
gtk.Range.get_restrict_to_fill_level().
Default value: True. Available in GTK+ 2.12."round-digits"Read-WriteThe number of digits to round the value to when it changes, or -1.
Default value: -1.
This property is available in GTK+ 2.24 and above.
"show-fill-level"Read-WriteThe show-fill-level property controls whether fill level indicator graphics are displayed on the trough. See gtk_range_set_show_fill_level().
gtk.Range.set_show_fill_level().
Default value: False.
Available in GTK+ 2.12."update-policy"Read-WriteHow the range should be updated on the screen:
gtk.UPDATE_CONTINUOUS,
gtk.UPDATE_DISCONTINUOUS,
gtk.UPDATE_DELAYED."upper-stepper-sensitivity"Read-WriteThe sensitivity policy for the stepper that points to the
adjustment's upper side.
Default value: gtk.SENSITIVITY_AUTO
"activate-slider"ReadWith this option set to True,
sliders will be drawn ACTIVE and with
shadow IN while they are dragged"arrow-displacement-x"ReadThe distance horizontally to move the arrow when the
button is depressed"arrow-displacement-y"ReadThe distance vertically to move the arrow when the
button is depressed"arrow-scaling"ReadThe arrow size proportion relative to the scroll button size.
Allowed values: [0,1]. Default value: 0.5.
Available from GTK+ 2.14."slider-width"ReadThe width of scrollbar or scale thumb"stepper-size"ReadThe length of step buttons at ends"stepper-spacing"ReadThe spacing between step buttons and thumb"trough-border"ReadThe spacing between thumb or steppers and outer trough
bevel"trough-side-details"ReadThis property is available in GTK+ 2.10 and above."trough-under-steppers"Readif True draw the trough across the
full length of the range or to exclude the steppers and their
spacing. Note that setting the "stepper-spacing" style
property to any value > 0 will automatically enable
"trough-under-steppers" too. This property is available in
GTK+ 2.10 and above.
gtk.Range Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypesgtk.Widget Signal Prototypes"adjust-bounds"callbackrangevalueuser_param1..."change-value"callbackrangescrollvaluearg1arg2user_param1..."move-slider"callbackrangescrolltypeuser_param1..."value-changed"callbackrangeuser_param1...DescriptionThe gtk.Range is the base
class for the gtk.Scale and gtk.Scrollbar
widgets. The gtk.Range provides
the common functionality for these widgets that allow a user to set a value
in a range of values. The gtk.Scale works in
conjunction with a gtk.Adjustment
which provides the range information.Methodsgtk.Range.set_update_policyset_update_policypolicypolicy :the update policy:
gtk.UPDATE_CONTINUOUS,
gtk.UPDATE_DISCONTINUOUS,
gtk.UPDATE_DELAYEDThe set_update_policy() method sets the
"update-policy" property to the value specified by
policy. The update policy has the following values
and effects:gtk.UPDATE_CONTINUOUSanytime the range slider is moved, the range value will
change and the "value_changed" signal will be emitted.gtk.UPDATE_DELAYEDthe value will be updated after a brief timeout where
no slider motion occurs, so value changes are delayed slightly rather than
continuously updated.gtk.UPDATE_DISCONTINUOUSthe value will only be updated when the user releases
the button and ends the slider drag operation.gtk.Range.get_update_policyget_update_policyReturns :the current update policyThe get_update_policy() method gets the
value of the "update-policy" property. The update policy is one of:
gtk.UPDATE_CONTINUOUS,
gtk.UPDATE_DISCONTINUOUS or
gtk.UPDATE_DELAYED. See the set_update_policy()
method for details.gtk.Range.set_adjustmentset_adjustmentadjustmentadjustment :a gtk.AdjustmentThe set_adjustment() method sets the
"adjustment" property to the value specified by
adjustment. The gtk.Adjustment
is used as the "model" object for this range widget.
adjustment indicates the current range value, the
minimum and maximum range values, the step and 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.gtk.Range.get_adjustmentget_adjustmentReturns :a gtk.AdjustmentThe get_adjustment() method returns the
value of the "adjustment" property. See the set_adjustment()
method for details.gtk.Range.set_invertedset_invertedsettingsetting :if True invert the
rangeThe set_inverted() method sets the
"inverted" property to the value specified by
setting. If setting is
True the normal motion of the range widget is reversed.
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 left rather than on the bottom or right.gtk.Range.get_invertedget_invertedReturns :True if the range is
invertedThe get_inverted() method returns the
value of the "inverted" property that was set by the set_inverted()
method.gtk.Range.set_incrementsset_incrementssteppagestep :the step sizepage :the page sizeThe set_increments() method sets the
step and page sizes for the range to the values specified by
step and page respectively.
The step size is used when the user clicks the gtk.Scrollbar
arrows or moves gtk.Scale via the
arrow keys. The page size is used for example when moving via Page
Up or Page Down keys.gtk.Range.set_rangeset_rangeminmaxmin :the minimum range valuemax :the maximum range valueThe set_range() method sets the minimum
and maximum allowable values for the gtk.Range to that
values specified by min and
max respectively. If the range has a non-zero page
size, it is also forced to be between min and
max.gtk.Range.set_valueset_valuevaluevalue :the new value of the rangeThe set_value() method sets the current
value of the range to the value specified by value.
value will be forced inside the minimum or maximum
range values. The range emits the "value_changed" signal if the value
changes.gtk.Range.get_valueget_valueReturns :the current value of the
range.The get_value() method gets the current
value of the range.gtk.Range.set_fill_levelset_fill_levelfill_levelfill_level :the new position of the fill level indicator.
The set_fill_level() method sets
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.
gtk.Range.get_fill_levelget_fill_levelReturns :The current fill level.
The get_fill_level() method gets the current
position of the fill level indicator.
gtk.Range.set_restrict_to_fill_levelset_restrict_to_fill_levelrestrict_to_fill_levelrestrict_to_fill_level :Whether the fill level restricts slider movement.
The set_restrict_to_fill_level() method 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.
gtk.Range.get_restrict_to_fill_levelget_restrict_to_fill_levelReturns :True if range is
restricted to the fill level.
The get_restrict_to_fill_level() method gets
whether the range is restricted to the fill level.
gtk.Range.set_show_fill_levelset_show_fill_levelshow_fill_levelshow_fill_level :Whether a fill level indicator graphics is shown.
The set_show_fill_level() method 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.
gtk.Range.get_show_fill_levelget_show_fill_levelReturns :True if range shows the
fill level.
The get_show_fill_level() method gets
whether the range displays the fill level graphically.
gtk.Range.set_round_digitsset_round_digitsround_digitsround_digits :the precision in digits, or -1.This method is available in PyGTK 2.24 and above.The set_round_digits() method sets the number of digits
to round the value to when it changes. See "change-value".gtk.Range.get_round_digitsget_round_digitsReturns :the number of digits to round to.This method is available in PyGTK 2.24 and above.The get_round_digits() method gets the number of digits
to round the value to when it changes. See "change-value".gtk.Range.set_min_slider_sizeset_min_slider_sizemin_sizemin_size :The slider's minimum size.This method is available in PyGTK 2.22 and above.The set_min_slider_size() method sets the minimum size of the range's slider.This method is useful mainly for GtkRange subclasses.gtk.Range.get_min_slider_sizeget_min_slider_sizeReturns :The minimum size of the range's slider.This method is available in PyGTK 2.22 and above.The get_min_slider_size() method gets the minimum size of the range's slider.This method is useful mainly for GtkRange subclasses.gtk.Range.get_range_rectget_range_rectReturns :the range rectangle.This method is available in PyGTK 2.22 and above.The get_range_rect() method returns the area
that contains the range's trough and its steppers.This method is useful mainly for GtkRange subclasses.gtk.Range.set_slider_size_fixedset_slider_size_fixedsize_fixedsize_fixed :True to make the slider size constant.This method is available in PyGTK 2.22 and above.The set_slider_size_fixed() method sets whether the
range's slider has a fixed size, or a size that depends on it's adjustment's page
size.This method is useful mainly for GtkRange subclasses.gtk.Range.get_slider_size_fixedget_slider_size_fixedReturns :True when the range's slider has a fixed size.This method is available in PyGTK 2.22 and above.The get_slider_size_fixed() method returns whether the
range's slider has a fixed size, or a size that depends on it's adjustment's page
size.gtk.Range.set_flippableset_flippableflippableflippable :True to make the range flippable.This method is available in PyGTK 2.22 and above.The set_flippable() method sets whether the
range is flippable. If a range is flippable, it will switch its direction if
it is horizontal and its direction is gtk.TEXT_DIR_RTL.gtk.Range.get_flippableget_flippableReturns :>True if the range is flippable.This method is available in PyGTK 2.22 and above.The get_flippable() method returns whether the
range is flippable.gtk.Range.set_lower_stepper_sensitivityset_lower_stepper_sensitivitysensitivitysensitivity :the lower stepper's sensitivity policy..The set_lower_stepper_sensitivity() method sets the
sensitivity policy for the stepper that points to the 'lower' end of the range's
adjustment.gtk.Range.get_lower_stepper_sensitivityget_lower_stepper_sensitivityReturns :The lower stepper's sensitivity policy.The get_lower_stepper_sensitivity() method gets the
sensitivity policy for the stepper that points to the 'lower' end of the range's
adjustment.gtk.Range.set_upper_stepper_sensitivityset_upper_stepper_sensitivitysensitivitysensitivity :The upper stepper's sensitivity policy.The set_upper_stepper_sensitivity() method sets the
sensitivity policy for the stepper that points to the 'upper' end of the range's
adjustment.gtk.Range.get_upper_stepper_sensitivityget_upper_stepper_sensitivityReturns :The upper stepper's sensitivity policy.The get_upper_stepper_sensitivity() method gets the
sensitivity policy for the stepper that points to the 'upper' end of the range's
adjustment.SignalsThe "adjust-bounds" gtk.Range Signalcallbackrangevalueuser_param1...range :the range that received the
signalvalue :the valueuser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "adjust-bounds" signal is emitted when the range is adjusted
by user action. Note the value can be more or less than the range since it
depends on the mouse position.The "change-value" gtk.Range Signalcallbackrangescrollvalueuser_param1...range :the range that received the signal. the object
which received the signal.scroll :the type of scroll action that was performed -
one of the ..value :the new value resulting from the scroll
action.user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if any)Returns :True to prevent other
handlers from being invoked for the signal or
False to propagate the signal
further.This signal is available in GTK+ 2.6 and above.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
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.It is not possible to use delayed update policies in an
overridden "change-value" handler.The "move-slider" gtk.Range Signalcallbackrangescrolltypeuser_param1...range :the range that received the
signalscrolltype :the scroll type issued because a key was
pressed by the user; one of the .user_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "move-slider" signal is emitted when the user presses a key
(e.g. Page Up, Home, Right
Arrow) to move the slider.The "value-changed" gtk.Range Signalcallbackrangeuser_param1...range :the range that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "value-changed" signal is emitted when the range value is
changed either programmatically or by user action.