pyvista.RenderWindowInteractor.remove_observers

pyvista.RenderWindowInteractor.remove_observers#

RenderWindowInteractor.remove_observers(event=None)[source]#

Remove all observers.

Parameters:
eventstr | int, optional

If provided, only removes observers of the given event. Otherwise, if it is None, removes all observers.

Examples

Add two observers and immediately remove them.

>>> import pyvista as pv
>>> pl = pv.Plotter()
>>> obs_enter = pl.iren.add_observer('EnterEvent', lambda *_: print('Enter!'))
>>> obs_leave = pl.iren.add_observer('LeaveEvent', lambda *_: print('Leave!'))
>>> pl.iren.remove_observers()
../../../_images/pyvista-RenderWindowInteractor-remove_observers-1_00_00.png