SimpleCheckBox

class omni.kit.window.extensions.ext_components.SimpleCheckBox(checked: bool, on_checked_fn: Callable, text: Optional[str] = None, model=None, enabled=True)

Bases: object

A simple check box UI element with an optional text label.

This class creates a checkbox with a label, and allows for a callback function to be executed when the checkbox state changes. It can be enabled or disabled and can have a bound data model.

Parameters
  • checked (bool) – Initial checked state of the checkbox.

  • on_checked_fn (Callable) – Function to call when checkbox state changes.

  • text (str, optional) – Text to display next to the checkbox. Defaults to None.

  • model (ui.SimpleBoolModel, optional) – Data model to bind to the checkbox. Defaults to None.

  • enabled (bool, optional) – Specifies if the checkbox is interactable. Defaults to True.

Methods

__init__(checked, on_checked_fn[, text, ...])

Initializes a simple checkbox with a label and a callback function.

__init__(checked: bool, on_checked_fn: Callable, text: Optional[str] = None, model=None, enabled=True)

Initializes a simple checkbox with a label and a callback function.