PlayPauseButton#

class ansys.tools.visualization_interface.backends.pyvista.widgets.play_pause_button.PlayPauseButton(plotter: pyvista.Plotter, animation, dark_mode: bool = False)#

Bases: ansys.tools.visualization_interface.backends.pyvista.widgets.button.Button

Provides play/pause toggle control for animations.

This button switches between play and pause icons dynamically based on the animation state.

Parameters:
plotterPlotter

Plotter to draw the button on.

animationAnimation

Animation instance to control.

dark_modebool, optional

Whether to activate the dark mode or not.

Overview#

callback

Toggle between play and pause.

Import detail#

from ansys.tools.visualization_interface.backends.pyvista.widgets.play_pause_button import PlayPauseButton

Method detail#

PlayPauseButton.callback(state: bool) None#

Toggle between play and pause.

Parameters:
statebool

Whether the button is active (playing).