Gtk.Range


Gtk.Range — Base class for widgets which visualize an adjustment

Object Hierarchy:

    GObject
    ╰── GInitiallyUnowned
        ╰── Gtk.Widget
            ╰── Gtk.Range
                ├── Gtk.Scale
                ╰── Gtk.Scrollbar

Functions:


Signals:

  • “adjust-bounds” (range, value, user_data)
  • “change-value” (range, scroll, value, user_data)
  • “move-slider” (range, step, user_data)
  • “value-changed” (range, user_data)

Description:

Gtk.Range is the common base class for widgets which visualize an adjustment, e.g GtkScale or Gtk.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. See Gtk.Range::set_fill_level().


Function Details:

get_fill_level()

get_fill_level (self) -> float

Gets the current position of the fill level indicator.

  • Returns: The current fill level

  • Since: 2.12


get_restrict_to_fill_level()

get_restrict_to_fill_level (self) -> bool

Gets whether the range is restricted to the fill level.

  • Returns: True if rangeis restricted to the fill level.

  • Since: 2.12


get_show_fill_level()

get_show_fill_level (self) -> bool

Gets whether the range displays the fill level graphically.

  • Returns: True if rangeshows the fill level.

  • Since: 2.12


set_fill_level()

set_fill_level (self, fill_level:float)

Set the new position of the fill level indicator. The “fill level” is probably best described by its most prominentuse case, which is an indicator for the amount of pre-buffering ina streaming media player. In that use case, the value of the rangewould indicate the current play position, and the fill level wouldbe the position up to which the file/stream has been downloaded. This amount of prebuffering can be displayed on the range’s troughand is themeable separately from the trough. To enable fill leveldisplay, use Gtk.Range:set_show_fill_level(). The range defaultsto not showing the fill level. Additionally, it’s possible to restrict the range’s slider positionto values which are smaller than the fill level. This is controllerby Gtk.Range:set_restrict_to_fill_level() and is by defaultenabled.

  • Since: 2.12

set_restrict_to_fill_level()

set_restrict_to_fill_level (self, restrict_to_fill_level:bool)

Sets whether the slider is restricted to the fill level. SeeGtk.Range:set_fill_level() for a general description of the filllevel concept.

  • Since: 2.12

set_show_fill_level()

set_show_fill_level (self, show_fill_level:bool)

Sets whether a graphical fill level is show on the trough. SeeGtk.Range:set_fill_level() for a general description of the filllevel concept.

  • Since: 2.12

get_adjustment()

get_adjustment (self) -> Gtk.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 notbe unreferenced.

  • Returns: a Gtk.Adjustment.

set_adjustment()

set_adjustment (self, adjustment:Gtk.Adjustment)

Sets the adjustment to be used as the “model” object for this rangewidget. The adjustment indicates the current range value, theminimum and maximum range values, the step/page increments usedfor keybindings and scrolling, and the page size. The page sizeis normally 0 for Gtk.Scale and nonzero for Gtk.Scrollbar, andindicates the size of the visible area of the widget being scrolled.The page size affects the size of the scrollbar slider.


get_inverted()

get_inverted (self) -> bool

Gets the value set by Gtk.Range:set_inverted().

  • Returns: True if the range is inverted

set_inverted()

set_inverted (self, setting:bool)

Ranges normally move from lower to higher values as theslider moves from top to bottom or left to right. Invertedranges have higher values at the top or on the right rather thanon the bottom or left.


get_value()

get_value (self) -> float

Gets the current value of the range.

  • Returns: current value of the range.

set_value()

set_value (self, value:float)

Sets the current value of the range; if the value is outside theminimum or maximum range values, it will be clamped to fit insidethem. The range emits the “value-changed” signal if the value changes.


set_increments()

set_increments (self, step:float, page:float)

Sets the step and page sizes for the range.The step size is used when the user clicks the Gtk.Scrollbararrows or moves Gtk.Scale via arrow keys. The page sizeis used for example when moving via Page Up or Page Down keys.


set_range()

set_range (self, min:float, max:float)

Sets the allowable values in the Gtk.Range, and clamps the rangevalue to be between min and max. (If the range has a non-zeropage size, it is clamped between min and max - page-size.)


get_round_digits()

get_round_digits (self) -> int

Gets the number of digits to round the value to whenit changes. See “change-value”.

  • Returns: the number of digits to round to

  • Since: 2.24


set_round_digits()

set_round_digits (self, round_digits:int)

Sets the number of digits to round the value to whenit changes. See “change-value”.

  • Since: 2.24

set_lower_stepper_sensitivity()

set_lower_stepper_sensitivity (self, sensitivity:Gtk.SensitivityType)

Sets the sensitivity policy for the stepper that points to the'lower' end of the Gtk.Range’s adjustment.

  • Since: 2.10

get_lower_stepper_sensitivity()

get_lower_stepper_sensitivity (self) -> Gtk.SensitivityType

Gets the sensitivity policy for the stepper that points to the'lower' end of the Gtk.Range’s adjustment.

  • Returns: The lower stepper’s sensitivity policy.

  • Since: 2.10


set_upper_stepper_sensitivity()

set_upper_stepper_sensitivity (self, sensitivity:Gtk.SensitivityType)

Sets the sensitivity policy for the stepper that points to the'upper' end of the Gtk.Range’s adjustment.

  • Since: 2.10

get_upper_stepper_sensitivity()

get_upper_stepper_sensitivity (self) -> Gtk.SensitivityType

Gets the sensitivity policy for the stepper that points to the'upper' end of the Gtk.Range’s adjustment.

  • Returns: The upper stepper’s sensitivity policy.

  • Since: 2.10


get_flippable()

get_flippable (self) -> bool

Gets the value set by Gtk.Range:set_flippable().

  • Returns: True if the range is flippable

  • Since: 2.18


set_flippable()

set_flippable (self, flippable:bool)

If a range is flippable, it will switch its direction if it ishorizontal and its direction is GTK_TEXT_DIR_RTL. See `Gtk.Widget:get_direction()`.

  • Since: 2.18

get_min_slider_size()

get_min_slider_size (self) -> int

This function is useful mainly for Gtk.Range subclasses. See Gtk.Range:set_min_slider_size().

  • Returns: The minimum size of the range’s slider.

  • Since: 2.20


get_range_rect()

get_range_rect (self) -> range_rect:Gdk.Rectangle

This function returns the area that contains the range’s troughand its steppers, in widget->window coordinates. This function is useful mainly for Gtk.Range subclasses.

  • Since: 2.20

get_slider_range()

get_slider_range (self) -> slider_start:int, slider_end:int

This function returns sliders range along the long dimension,in widget->window coordinates. This function is useful mainly for Gtk.Range subclasses.

  • Since: 2.20

get_slider_size_fixed()

get_slider_size_fixed (self) -> bool

This function is useful mainly for Gtk.Range subclasses. See Gtk.Range:set_slider_size_fixed().

  • Returns: whether the range’s slider has a fixed size.

  • Since: 2.20


set_min_slider_size()

set_min_slider_size (self, min_size:int)

Sets the minimum size of the range’s slider. This function is useful mainly for Gtk.Range subclasses.

  • Since: 2.20

set_slider_size_fixed()

set_slider_size_fixed (self, size_fixed:bool)

Sets whether the range’s slider has a fixed size, or a size thatdepends on its adjustment’s page size. This function is useful mainly for Gtk.Range subclasses.

  • Since: 2.20

results matching ""

    No results matching ""