edifice.CheckBox

edifice.CheckBox#

class edifice.CheckBox(checked=False, text='', on_change=None, **kwargs)[source]#

Bases: QtWidgetElement

Checkbox widget.

../_images/checkbox_dropdown.png

Checkbox on the left.#

A checkbox allows the user to specify some boolean state.

The checked prop determines the initial check-state of the widget. When the user toggles the check state, the on_change callback is called with the new check state.

Parameters:
  • checked (bool) – Whether or not the CheckBox is checked.

  • text (str) – Text for the label of the CheckBox.

  • on_change (Optional[Callable[[bool], Optional[Awaitable[None]]]]) – Event handler for when the checked value changes, but only when the user checks or unchecks, not when the checked prop changes.

Methods

__init__([checked, text, on_change])

register_ref(reference)

Registers provided Reference to this Element.

set_key(key)

Sets the key of the Element.

Attributes

children

The children of this Element.

props

The props of this Element.

underlying

The underlying QWidget, which may not exist if this Element has not rendered.