gale.ui.checkbox module
This file contains the implementation of the class Checkbox: a square toggle firing on_change(checked) on click or on_confirm while focused.
Author: Alejandro Mujica (aledrums@gmail.com)
- class gale.ui.checkbox.Checkbox(x, y, size, checked=False, on_change=None, theme=None)[source]
Bases:
WidgetA square toggle. Fires on_change(checked) whenever its state flips, either by a mouse click or by on_confirm while focused.
- Parameters:
x (float)
y (float)
size (float)
checked (bool)
on_change (Callable[[bool], None] | None)
theme (Theme | None)
- on_mouse_click(position, data)[source]
- Parameters:
position (Tuple[float, float])
data (MouseClickData)
- Return type:
bool