add_checkbox_button_widget#
- Plotter.add_checkbox_button_widget(callback, value=False, position=(10.0, 10.0), size=50, border_size=5, color_on='blue', color_off='grey', background_color='white')#
Add a checkbox button widget to the scene.
This is useless without a callback function. You can pass a callable function that takes a single argument, the state of this button widget and performs a task with that value.
- Parameters
- callback
callable()
The method called every time the button is clicked. This should take a single parameter: the bool value of the button.
- valuebool,
optional
The default state of the button.
- position
tuple
(float
),optional
The absolute coordinates of the bottom left point of the button.
- size
int
,optional
The size of the button in number of pixels.
- border_size
int
,optional
The size of the borders of the button in pixels.
- color_on
color_like
,optional
The color used when the button is checked. Default is
'blue'
.- color_off
color_like
,optional
The color used when the button is not checked. Default is
'grey'
.- background_color
color_like
,optional
The background color of the button. Default is
'white'
.
- callback
- Returns
vtk.vtkButtonWidget
The VTK button widget configured as a checkbox button.