add_text_slider_widget#
- WidgetHelper.add_text_slider_widget(callback, data, value=None, pointa=(0.4, 0.9), pointb=(0.9, 0.9), color=None, event_type='end', style=None)[source]#
Add a text slider bar widget.
This is useless without a callback function. You can pass a callable function that takes a single argument, the value of this slider widget, and performs a task with that value.
- Parameters
- callback
callable()
The method called every time the slider is updated. This should take a single parameter: the float value of the slider.
- data
list
The list of possible values displayed on the slider bar.
- value
float
,optional
The starting value of the slider.
- pointa
tuple
(float
),optional
The relative coordinates of the left point of the slider on the display port.
- pointb
tuple
(float
),optional
The relative coordinates of the right point of the slider on the display port.
- color
color_like
,optional
Either a string, RGB list, or hex color string. Defaults to
pyvista.global_theme.font.color
.- event_type
str
,optional
Either
'start'
,'end'
or'always'
, this defines how often the slider interacts with the callback.- style
str
,optional
The name of the slider style. The list of available styles are in
pyvista.global_theme.slider_styles
. Defaults toNone
.
- callback
- Returns
vtk.vtkSliderWidget
The VTK slider widget configured to display text.