pyvista.Plotter.add_text_slider_widget#
- Plotter.add_text_slider_widget(
- callback,
- data,
- value=None,
- pointa=(0.4, 0.9),
- pointb=(0.9, 0.9),
- color=None,
- interaction_event='end',
- style=None,
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
ColorLike
,optional
Either a string, RGB list, or hex color string. Defaults to
pyvista.global_theme.font.color
.- interaction_event
vtk.vtkCommand.EventIds
,str
,optional
The VTK interaction event to use for triggering the callback. Accepts either the strings
'start'
,'end'
,'always'
or avtk.vtkCommand.EventIds
.Changed in version 0.38.0: Changed from
event_type
tointeraction_event
and now accepts either strings orvtk.vtkCommand.EventIds
.- 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.