Slider¶
Widget description¶
The slider adds a draggable “slider” widget for selecting the value of something within a range.
A slider can be horizontal or vertical. It can contain an Icon and has a
primary label as well as a units label (that is formatted with floating
point values and thus accepts a printf-style format string, like
"%1.2f units"
. There is also an indicator string that may be somewhere
else (like on the slider itself) that also accepts a format string like
units. Label, Icon Unit and Indicator strings/objects are optional.
A slider may be inverted which means values invert, with high vales being on the left or top and low values on the right or bottom (as opposed to normally being low on the left or top and high on the bottom and right).
The slider should have its minimum and maximum values set by the
application with Slider.min_max
and value should also be set by
the application before use with Slider.value
. The span of the
slider is its length (horizontally or vertically). This will be scaled by
the object or applications scaling factor. At any point code can query the
slider for its value with Slider.value
.
Emitted signals¶
changed
- Whenever the slider value is changed by the user.slider,drag,start
- dragging the slider indicator around has started.slider,drag,stop
- dragging the slider indicator around has stopped.delay,changed
- A short time after the value is changed by the user. This will be called only when the user stops dragging for a very short period or when they release their finger/mouse, so it avoids possibly expensive reactions to the value change.
Layout content parts¶
icon
- An icon of the sliderend
- A end part content of the slider
Layout text parts¶
default
- Label of the slider
Inheritance diagram¶
- class efl.elementary.Slider(Object parent, *args, **kwargs)¶
Bases:
efl.elementary.__init__.LayoutClass
This is the class that actually implements the widget.
- Parameters
parent (
efl.evas.Object
) – The parent object**kwargs – All the remaining keyword arguments are interpreted as properties of the instance
- callback_changed_add(func, *args, **kwargs)¶
Whenever the slider value is changed by the user.
- callback_changed_del(func)¶
- callback_delay_changed_add(func, *args, **kwargs)¶
A short time after the value is changed by the user. This will be called only when the user stops dragging for a very short period or when they release their finger/mouse, so it avoids possibly expensive reactions to the value change.
- callback_delay_changed_del(func)¶
- callback_slider_drag_start_add(func, *args, **kwargs)¶
Dragging the slider indicator around has started.
- callback_slider_drag_start_del(func)¶
- callback_slider_drag_stop_add(func, *args, **kwargs)¶
Dragging the slider indicator around has stopped.
- callback_slider_drag_stop_del(func)¶
- horizontal¶
The orientation of a given slider widget.
This property reflects how your slider is to be disposed: vertically or horizontally.
By default it’s displayed horizontally.
- Type
bool
- horizontal_get()¶
- horizontal_set(horizontal)¶
- indicator_format¶
The format string for the indicator label.
The slider may display its value somewhere else then unit label, for example, above the slider knob that is dragged around. This function sets the format string used for this.
If
None
, indicator label won’t be visible. If not it sets the format string for the label text. To the label text is provided a floating point value, so the label text can display up to 1 floating point value. Note that this is optional.Use a format string such as
"%1.2f meters"
for example, and it will display values like: “3.14 meters” for a value equal to 3.14159.Default is indicator label disabled.
- Type
unicode
- indicator_format_get()¶
- indicator_format_set(ind_format)¶
- indicator_show¶
Whether to enlarge slider indicator (augmented knob) or not.
By default, indicator will be bigger while dragged by the user.
Warning
It won’t display values set with
indicator_format
if you disable indicator.- Type
bool
- indicator_show_get()¶
- indicator_show_on_focus¶
Whether to show the indicator of the slider on focus.
- Type
bool
New in version 1.18.
- indicator_show_on_focus_get()¶
- indicator_show_on_focus_set(show)¶
- indicator_show_set(show)¶
- indicator_visible_mode¶
The visible mode of indicator
New in version 1.14.
- indicator_visible_mode_get()¶
- indicator_visible_mode_set(indicator_visible_mode)¶
- inverted¶
Invert a given slider widget’s displaying values order
A slider may be inverted, in which state it gets its values inverted, with high vales being on the left or top and low values on the right or bottom, as opposed to normally have the low values on the former and high values on the latter, respectively, for horizontal and vertical modes.
- Type
bool
- inverted_get()¶
- inverted_set(inverted)¶
- min_max¶
The minimum and maximum values for the slider.
If actual value is less than
min
, it will be updated tomin
. If it is bigger thenmax
, will be updated tomax
. Actual value can be get withvalue
.By default, min is equal to 0.0, and max is equal to 1.0.
Warning
Maximum must be greater than minimum, otherwise behavior is undefined.
- Type
(float, float)
- min_max_get()¶
- min_max_set(min, max)¶
- range¶
The values of the two indicators.
- Type
(float, float)
New in version 1.18.
- range_enabled¶
Enables the range ability.
This enables two indicators in slider, so that the user can select a range, not just a single value.
- Type
bool
New in version 1.18.
- range_enabled_get()¶
- range_enabled_set(enabled)¶
- range_get()¶
- range_set(fr, to)¶
- span_size¶
The (exact) length of the bar region of a given slider widget.
This property reflects the minimum width (when in horizontal mode) or height (when in vertical mode) of the actual bar area of the slider. This in turn affects the object’s minimum size. Use this when you’re not setting other size hints expanding on the given direction (like weight and alignment hints) and you would like it to have a specific size.
Note
Icon, end, label, indicator and unit text around the object will require their own space, which will make the object to require more the
size
, actually.- Type
int
- span_size_get()¶
- span_size_set(size)¶
- step¶
The step by which slider indicator will move.
This value is used when draggable object is moved automatically i.e., in case of key event when up/down/left/right key is pressed or in case when accessibility is set and flick event is used to inc/dec slider values. By default step value is equal to 0.05.
- Type
double
New in version 1.8.
- step_get()¶
- step_set(step)¶
- unit_format¶
The format string for the unit label.
Unit label is displayed all the time, if set, after slider’s bar. In horizontal mode, at right and in vertical mode, at bottom.
If
None
, unit label won’t be visible. If not it sets the format string for the label text. To the label text is provided a floating point value, so the label text can display up to 1 floating point value. Note that this is optional.Use a format string such as
"%1.2f meters"
for example, and it will display values like: “3.14 meters” for a value equal to 3.14159.Default is unit label disabled.
- Type
unicode
- unit_format_get()¶
- unit_format_set(unit_format)¶
- value¶
The value displayed in the slider.
Value will be presented on the unit label following format specified with
unit_format
and on indicator withindicator_format
.Warning
The value must to be between min and max values. These values are set by
min_max
.See also
- Type
float
- value_get()¶
- value_set(value)¶