Slider#
Available in backends: qt
, ipynb
Signals#
changed(object)
- Emitted when the widget value changes.label_changed(str)
- Emitted when the widget label changes.native_parent_changed(object)
- Emitted with the backend widget when the widget parent changes.
Slider
#
Bases: SliderWidget[int]
A slider widget to adjust an integer value within a range.
Parameters:
-
value
(Any
, default:Undefined
) –The starting value for the widget.
-
min
(float
, default:Undefined
) –The minimum allowable value, by default 0 (or
value
ifvalue
is less than 0) -
max
(float
, default:Undefined
) –The maximum allowable value, by default 999 (or
value
ifvalue
is greater than 999) -
step
(float
, default:Undefined
) –The step size for incrementing the value, by default adaptive step is used
-
orientation
((str, {'horizontal', 'vertical'})
, default:'horizontal'
) –The orientation for the slider, by default "horizontal"
-
readout
(bool
, default:True
) –Whether to show the editable spinbox next to the slider
-
tracking
(bool
, default:True
) –If tracking is enabled (the default), the slider emits the
changed
signal while the slider is being dragged. If tracking is disabled, the slider emits thechanged
signal only after the user releases the slider. -
bind
(Callable[[ValueWidget], Any] | Any
, default:Undefined
) –A value or callback to bind this widget. If provided, whenever
widget.value
is accessed, the value provided here will be returned instead.bind
may be a callable, in which casebind(self)
will be returned (i.e. your bound callback must accept a single parameter, which is this widget instance). -
nullable
(bool
, default:False
) –If
True
, the widget will acceptsNone
as a valid value, by defaultFalse
. -
**base_widget_kwargs
(Any
, default:{}
) –All additional keyword arguments are passed to the base
magicgui.widgets.Widget
constructor.