App.checkbox

App.checkbox(text, checked=True, parent=None)[source]

Decorator for checkbox actions.

Parameters
textstr

The text label of the checkbox.

checkedbool, optional

If True, the checkbox will be displayed as checked.

Returns
callable

Notes

Use this method to convert a function into the callback action of a checkbox, and automatically add the checkbox to the sidebar.

Examples

@viewer.checkbox('Check me!')
def check(app):
    app.info('Thanks for checking...')