# Examples from pyvista.Plotter.add_checkbox_button_widget
# ========================================================

# The following example generates a static image of the widget.
import pyvista as pv
mesh = pv.Sphere()
pl = pv.Plotter()
actor = pl.add_mesh(mesh)
def toggle_vis(flag):
    actor.SetVisibility(flag)
_ = pl.add_checkbox_button_widget(toggle_vis, value=True)
pl.show()

# Download the interactive example at Checkbox Widget.

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

