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)[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:
callbackcallable()

The method called every time the slider is updated. This should take a single parameter: the float value of the slider.

datalist

The list of possible values displayed on the slider bar.

valuefloat, optional

The starting value of the slider.

pointatuple(float), optional

The relative coordinates of the left point of the slider on the display port.

pointbtuple(float), optional

The relative coordinates of the right point of the slider on the display port.

colorColorLike, optional

Either a string, RGB list, or hex color string. Defaults to pyvista.global_theme.font.color.

interaction_eventvtk.vtkCommand.EventIds, str, optional

The VTK interaction event to use for triggering the callback. Accepts either the strings 'start', 'end', 'always' or a vtk.vtkCommand.EventIds.

Changed in version 0.38.0: Changed from event_type to interaction_event and now accepts either strings or vtk.vtkCommand.EventIds.

stylestr, optional

The name of the slider style. The list of available styles are in pyvista.global_theme.slider_styles. Defaults to None.

Returns:
vtk.vtkSliderWidget

The VTK slider widget configured to display text.