GLXCurses.Range module

class GLXCurses.Range.Range[source]

Bases: GLXCurses.Widget.Widget

Range — Base class for widgets which visualize an adjustment

Properties

adjustment

The GLXCurses.Adjustment.Adjustment that contains the current value of this range object.

Type:GLXCurses.Adjustment.Adjustment
Flags:Read / Write / Construct
fill_level

The fill level (e.g. prebuffering of a network stream). See GLXCurses.Adjustment.Adjustment.set_fill_level().

Type:float
Flags:Read / Write
Default value:1.79769e+308
inverted

Invert direction slider moves to increase range value.

Type:bool
Flags:Read / Write
Default value:False
model

The model to find matches in.

Type:TreeModel
Flags:Read / Write
lower_stepper_sensitivity

The sensitivity policy for the stepper that points to the adjustment’s lower side.

Type:bool
Flags:Read / Write
Default value:GLXCurses.GLXC.SENSITIVITY_AUTO
restrict_to_fill_level

The restrict-to-fill-level property controls whether slider movement is restricted to an upper boundary set by the fill level. See GLXCurses.Adjustment.Adjustment.set_restrict_to_fill_level().

Type:bool
Flags:Read / Write
Default value:True
round-digits

The number of digits to round the value to when it changes, or -1. See “change-value”.

Type:int
Flags:Read / Write
Allowed values:>= -1
Default value:-1
show_fill_level

The show-fill-level property controls whether fill level indicator graphics are displayed on the trough. See GLXCurses.Adjustment.Adjustment.set_show_fill_level().

Type:bool
Flags:Read / Write
Default value:False
upper_stepper_sensitivity

The sensitivity policy for the stepper that points to the adjustment’s upper side.

Type:GLXCurses.GLXC.SensitivityType
Flags:Read / Write
Default value:GLXC.SENSITIVITY_AUTO
get_fill_level()[source]

Gets the current position of the fill level indicator.

Returns:The current fill level
Return type:int
get_restrict_to_fill_level()[source]

Gets whether the range is restricted to the fill level.

Returns:True if range is restricted to the fill level.
Return type:bool
get_show_fill_level()[source]

Gets whether the range displays the fill level graphically.

Returns:True if range shows the fill level.
Return type:bool
set_fill_level(fill_level=1.79769e+308)[source]

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 GLXCurses.Range.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 GLXCurses.Range.Range.set_restrict_to_fill_level() and is by default enabled.

Parameters:fill_level (float) – the new position of the fill level indicator
Raises:TypeError – if fill_level is not a float type
set_restrict_to_fill_level(restrict_to_fill_level=True)[source]

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

Parameters:restrict_to_fill_level (bool) – Whether the fill level restricts slider movement.
Raises:TypeError – if restrict_to_fill_level is not a bool type
set_show_fill_level(show_fill_level)[source]

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

Parameters:show_fill_level (bool) – Whether a fill level indicator graphics is shown.
Raises:TypeError – if show_fill_level is not a bool type
get_adjustment()[source]

Get the GLXCurses.Adjustment.Adjustment which is the “model” object for GLXCurses.Range.Range. See GLXCurses.Range.Range.set_adjustment() for details.

That because GLXCurses.Range.Range use internally a GLXCurses.Adjustment.Adjustment, the Attribute adjustment should never been touch or unreferenced.

Returns:A GLXCurses.Adjustment.Adjustment
Return type:GLXCurses.Adjustment.Adjustment
set_adjustment(adjustment=None)[source]

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 GtkScale and nonzero for Scrollbar, and indicates the size of the visible area of the widget being scrolled. The page size affects the size of the scrollbar slider.

Parameters:adjustment (GLXCurses.Adjustment.Adjustment or None) – GLXCurses.Adjustment.Adjustment or None for create a new one
Raises:TypeError – if adjustment is not a GLXCurses.Adjustment.Adjustment or None
get_inverted()[source]

Gets the value set by GLXCurses.Range.Range.set_inverted().

Returns:True if the range is inverted
Return type:bool
set_inverted(setting=False)[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.

Parameters:setting (bool) – True to invert the range
Raises:TypeError – if setting is not a a bool type
get_value()[source]

Gets the current value of the range.

Returns:current value of the range.
Return type:float
set_value(value=<class 'float'>)[source]

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.

Parameters:value (float) – new value of the range
Raises:TypeError – if value is not a a float type
set_increments(step=<class 'float'>, page=<class 'float'>)[source]

Sets the step increment and page increment for the range. The step increment is used when the user clicks the GLXCurses.Scrollbar.Scrollbar arrows or moves GLXCurses.Scale.Scale via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.

Care: the GTK documentation is worng compare to the the GTK Code source: https://github.com/GNOME/gtk/blob/master/gtk/gtkrange.c#L1001

That is step_increment and page_increment it be upgrade via a Adjustment.configure() and not step size and page size.

Parameters:
  • step (float) – the new step increment
  • page (float) – the new page increment
set_range(min=None, max=None)[source]

Sets the allowable values in the GLXCurses.Range.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.)

Parameters:
  • min (float) – minimum range value
  • max (float) – maximum range value
get_round_digits()[source]

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

Returns:the number of digits to round to
Return type:int
set_round_digits(round_digits=-1)[source]

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

Parameters:round_digits (int) – the precision in digits, or -1
Raises:TypeError – if round_digits is not a a int type
set_lower_stepper_sensitivity(sensitivity='AUTO')[source]

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

Allowed Type:

The arrow is made insensitive if the thumb is at the end
GLXCurses.GLXC.SENSITIVITY_AUTO = ‘AUTO’
The arrow is always sensitive
GLXCurses.GLXC.SENSITIVITY_ON = ‘ON’
The arrow is always insensitive
GLXCurses.GLXC.SENSITIVITY_OFF = ‘OFF’
Parameters:sensitivity (GLXCurses.GLXC.SensitivityType) – the lower stepper’s sensitivity policy.
Raises:TypeError – if sensitivity is not a GLXCurses.GLXC.SensitivityType
get_lower_stepper_sensitivity()[source]

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

Returns:The lower stepper’s sensitivity policy.
Return type:GLXCurses.GLXC.SensitivityType
set_upper_stepper_sensitivity(sensitivity='AUTO')[source]

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

Parameters:sensitivity (GLXCurses.GLXC.SensitivityType) – The upper stepper’s sensitivity policy.
Raises:TypeError – if sensitivity is not a GLXCurses.GLXC.SensitivityType
get_upper_stepper_sensitivity()[source]

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

Returns:The upper stepper’s sensitivity policy.
Return type:GLXCurses.GLXC.SensitivityType
get_flippable()[source]

Gets the value set by GLXCurses.Range.Range.set_flippable().

Returns:True if the range is flippable
Return type:bool
set_flippable(flippable=False)[source]

If a range is flippable, it will switch its direction if it is horizontal and its direction is GLXCurses.GLXC.TEXT_DIR_RTL.

Parameters:flippable (bool) – True to make the range flippable
Raises:TypeError – if flippable is not a bool type.
get_range_rect()[source]

This function returns the area that contains the range’s trough and its steppers, in widget->window coordinates.

This function is useful mainly for Range subclasses.

Returns:list(x, y, width, height)
Return type:list
get_slider_range(slider_start=None, slider_end=None)[source]

This function returns sliders range along the long dimension, in widget->window coordinates.

This function is useful mainly for Range subclasses.

If slider_start or slider_end are not None it will return the value.

Example:

slider_start=None, slider_end=None return list [None; None]

slider_start=1, slider_end=1 return list [the_calculated_slider_start; the_calculated_slider_end]

Parameters:
  • slider_start – return location for the slider’s start, or None
  • slider_end – return location for the slider’s end, or None
get_slider_size_fixed()[source]

This function is useful mainly for GtkRange subclasses.

See GLXCurses.Range.Range.set_slider_size_fixed().

Returns:whether the range’s slider has a fixed size.
Return type:bool
set_slider_size_fixed(size_fixed=<class 'bool'>)[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 GtkRange subclasses.

Parameters:size_fixed (bool) – True to make the slider size constant
Raises:TypeError – if size_fixed is not a bool type.