enaml.widgets.slider

Classes

Slider

A simple slider widget that can be used to select from a range of integral values.

class enaml.widgets.slider.Slider(parent=None, **kwargs)[source]

Bases: Control

A simple slider widget that can be used to select from a range of integral values.

A SliderTransform can be used to transform the integer range of the slider into another data space. For more details, see enaml.stdlib.slider_transform.

minimum

The minimum slider value. If the minimum value is changed such that it becomes greater than the current value or the maximum value, then those values will be adjusted. The default is 0.

maximum

The maximum slider value. If the maximum value is changed such that it becomes smaller than the current value or the minimum value, then those values will be adjusted. The default is 100.

value

The position value of the Slider. The value will be clipped to always fall between the minimum and maximum.

single_step

Defines the number of steps that the slider will move when the user presses the arrow keys. The default is 1. An upper limit may be imposed according the limits of the client widget.

page_step

Defines the number of steps that the slider will move when the user presses the page_up/page_down keys. The Default is 10. An upper limit may be imposed on this value according to the limits of the client widget.

tick_position

A TickPosition enum value indicating how to display the tick marks. Note that the orientation takes precedence over the tick mark position and an incompatible tick position will be adapted according to the current orientation. The default tick position is ‘bottom’.

tick_interval

The interval to place between slider tick marks in units of value (as opposed to pixels). The minimum value is 0, which indicates that the choice is left up to the client.

orientation

The orientation of the slider. The default orientation is horizontal. When the orientation is flipped the tick positions (if set) also adapt to reflect the changes (e.g. the LEFT becomes TOP when the orientation becomes horizontal).

tracking

If True, the value is updated while sliding. Otherwise, it is only updated when the slider is released. Defaults to True.

auto_hug

Whether or not to automatically adjust the ‘hug_width’ and ‘hug_height’ values based on the value of ‘orientation’.

proxy

A reference to the ProxySlider object.

activated

An event fired when an object’s proxy is activated. It is triggered once during the object lifetime, at the end of the activate_proxy method.

background

The background color of the widget.

destroyed

An event fired when an object has been destroyed. It is triggered once during the object lifetime, just before the object is removed from the tree structure.

enabled

Whether or not the widget is enabled.

hug_height

How strongly a widget hugs it’s height hint. This is equivalent to the constraint:

(height == hint) | hug_height
hug_width

How strongly a widget hugs it’s width hint. This is equivalent to the constraint:

(width == hint) | hug_width
initialized

An event fired when an object is initialized. It is triggered once during the object lifetime, at the end of the initialize method.

name

Export the ‘name’ attribute as a declarative member.

style_class

The style class to which this item belongs. Multiple classes can be separated with whitespace. An empty string indicates the widget does not belong to any style class.