![]() |
Klang C++ 0.7.15
Language Reference (draft)
|
Language Guide / Controls and Parameters · Generated API signature Creates an on/off control. Use a toggle for a persistent on/off setting. Pass the initial state as a boolean. It defaults to false. The control value is 0 or 1. Add the control to the model’s Controls collection during setup. Pass Pass Toggle
klang::ToggleBasic use
controls = { Toggle("Enabled") };Optional properties
true as the second argument to start enabled.controls = { Toggle("Enabled", true) };Optional placement and size
Control::Size as the last argument. Its values are x, y, width, and height. Omit it for automatic layout.controls = { Toggle("Enabled", true, { 0, 0, 80, 24 }) };