Skip to content

CheckBox#

CheckBox widget

Available in backends: qt, ipynb

Signals#

  • changed(object) - Emitted when the button is clicked (may also be connected at the alias clicked).
  • label_changed(str) - Emitted when the widget label changes.
  • native_parent_changed(object) - Emitted with the backend widget when the widget parent changes.

CheckBox #

Bases: ButtonWidget

A checkbox with a text label.

Parameters:

  • value (bool, default: Undefined ) –

    The starting state of the widget.

  • text (str, default: None ) –

    The text to display on the button. If not provided, will use name.

  • bind (Callable[[ValueWidget], Any] | Any, default: Undefined ) –

    A value or callback to bind this widget. If provided, whenever widget.value is accessed, the value provided here will be returned instead. bind may be a callable, in which case bind(self) will be returned (i.e. your bound callback must accept a single parameter, which is this widget instance).

  • nullable (bool, default: False ) –

    If True, the widget will accepts None as a valid value, by default False.

  • **base_widget_kwargs (Any, default: {} ) –

    All additional keyword arguments are passed to the base magicgui.widgets.Widget constructor.