Page Contents

This Page

Slider

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

Bases: enaml.widgets.control.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 = None

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 = None

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 = None

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

single_step = None

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 = None

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 = None

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 = None

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 = None

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 = None

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

hug_width = None

Hug width is redefined as a property to be computed based on the orientation of the slider unless overridden by the user.

hug_height = None

Hug height is redefined as a property to be computed based on the orientation of the slider unless overridden by the user.

snapshot()[source]

Return a dictionary which contains all the state necessary to initialize a client widget.

bind()[source]

A method called after initialization which allows the widget to bind any event handlers necessary.

on_action_value_changed(content)[source]

Handle the ‘value_changed’ action from the client widget.

The content will contain the ‘value’ of the slider.

__implements__

alias of __NoInterface__

Backends

Qt

digraph inheritance5bf62ca8eb { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "QtSlider" [style="setlinewidth(0.5)",URL="#enaml.qt.qt_slider.QtSlider",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtControl" -> "QtSlider" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtControl" [style="setlinewidth(0.5)",URL="enaml.widgets.control.Control.html#enaml.qt.qt_control.QtControl",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtConstraintsWidget" -> "QtControl" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtConstraintsWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.constraints_widget.ConstraintsWidget.html#enaml.qt.qt_constraints_widget.QtConstraintsWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtWidget" -> "QtConstraintsWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; "QtWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.widget.Widget.html#enaml.qt.qt_widget.QtWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtObject" -> "QtWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

class enaml.qt.qt_slider.QtSlider(object_id, parent, session)[source]

Bases: enaml.qt.qt_control.QtControl

A Qt implementation of an Enaml Slider.

create_widget(parent, tree)[source]

Create the underlying QSlider widget.

create(tree)[source]

Create and initialize the underlying widget.

on_action_set_value(content)[source]

Handle the ‘set_value’ action from the Enaml widget.

on_action_set_maximum(content)[source]

Handle the ‘set_maximum’ action from the Enaml widget.

on_action_set_minimum(content)[source]

Handle the ‘set_minimum’ action from the Enaml widget.

on_action_set_orientation(content)[source]

Handle the ‘set_orientation’ action from the Enaml widget.

on_action_set_page_step(content)[source]

Handle the ‘set_page_step’ action from the Enaml widget.

on_action_set_single_step(content)[source]

Handle the ‘set_single_step’ action from the Enaml widget.

on_action_set_tick_interval(content)[source]

Handle the ‘set_tick_interval’ action from the Enaml widget.

on_action_set_tick_position(content)[source]

Handle the ‘set_tick_position’ action from the Enaml widget.

on_action_set_tracking(content)[source]

Handle the ‘set_tracking’ action from the Enaml widget.

on_value_changed()[source]

Send the ‘value_changed’ action to the Enaml widget when the slider value has changed.

set_value(value)[source]

Set the value of the underlying widget.

set_maximum(maximum)[source]

Set the maximum value of the underlying widget.

set_minimum(minimum)[source]

Set the minimum value of the underlying widget.

set_orientation(orientation)[source]

Set the orientation of the underlying widget.

set_page_step(page_step)[source]

Set the page step of the underlying widget.

set_single_step(single_step)[source]

Set the single step of the underlying widget.

set_tick_interval(interval)[source]

Set the tick interval of the underlying widget.

set_tick_position(tick_position)[source]

Set the tick position of the underlying widget.

set_tracking(tracking)[source]

Set the tracking of the underlying widget.

Wx

digraph inheritance19e7da8d56 { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "WxObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; "WxControl" [style="setlinewidth(0.5)",URL="enaml.widgets.control.Control.html#enaml.wx.wx_control.WxControl",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxConstraintsWidget" -> "WxControl" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.widget.Widget.html#enaml.wx.wx_widget.WxWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxObject" -> "WxWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxConstraintsWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.constraints_widget.ConstraintsWidget.html#enaml.wx.wx_constraints_widget.WxConstraintsWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxWidget" -> "WxConstraintsWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxSlider" [style="setlinewidth(0.5)",URL="#enaml.wx.wx_slider.WxSlider",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxControl" -> "WxSlider" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

class enaml.wx.wx_slider.WxSlider(object_id, parent, session)[source]

Bases: enaml.wx.wx_control.WxControl

A Wx implementation of an Enaml Slider.

create_widget(parent, tree)[source]

Create the underlying wxProperSlider widget.

create(tree)[source]

Create and initialize the slider control.

on_action_set_value(content)[source]

Handle the ‘set_value’ action from the Enaml widget.

on_action_set_maximum(content)[source]

Handle the ‘set_maximum’ action from the Enaml widget.

on_action_set_minimum(content)[source]

Handle the ‘set_minimum’ action from the Enaml widget.

on_action_set_orientation(content)[source]

Handle the ‘set_orientation’ action from the Enaml widget.

on_action_set_page_step(content)[source]

Handle the ‘set_page_step’ action from the Enaml widget.

on_action_set_single_step(content)[source]

Handle the ‘set_single_step’ action from the Enaml widget.

on_action_set_tick_interval(content)[source]

Handle the ‘set_tick_interval’ action from the Enaml widget.

on_action_set_tick_position(content)[source]

Handle the ‘set_tick_position’ action from the Enaml widget.

on_action_set_tracking(content)[source]

Handle the ‘set_tracking’ action from the Enaml widget.

on_value_changed(event)[source]

Send the ‘value_changed’ action to the Enaml widget when the slider value has changed.

set_value(value)[source]

Set the value of the underlying widget.

set_maximum(maximum)[source]

Set the maximum value of the underlying widget.

set_minimum(minimum)[source]

Set the minimum value of the underlying widget.

set_orientation(orientation)[source]

Set the orientation of the underlying widget.

set_page_step(page_step)[source]

Set the page step of the underlying widget.

set_single_step(single_step)[source]

Set the single step of the underlying widget.

set_tick_interval(interval)[source]

Set the tick interval of the underlying widget.

set_tick_position(tick_position)[source]

Set the tick position of the underlying widget.

set_tracking(tracking)[source]

Set the tracking of the underlying widget.