40 Checkbox(std::string label, std::function<
void(
bool)> on_change);
53 [[nodiscard]] std::string
render()
const override;
73 bool m_is_checked =
false;
74 std::function<void(
bool)> m_on_change;
Abstract base class for all TUI components.
A toggleable checkbox component.
Definition Checkbox.hpp:32
bool isChecked() const
Return the current checked state.
Definition Checkbox.cpp:18
bool handleInput(Defs::Key key) override
Handle a key event.
Definition Checkbox.cpp:36
std::string render() const override
Render the checkbox as an ANSI string.
Definition Checkbox.cpp:20
Abstract base for all TUI widgets.
Definition Component.hpp:38
std::variant< char, Special > Key
A single keypress from stdin, represented as either a printable character or a Special control key.
Definition Defs.hpp:45