Klang C++ 0.7.15
Language Reference (draft)
Loading...
Searching...
No Matches
Button

Language Guide / Controls and Parameters · Generated API signature

Button

klang::Button

Creates a momentary button.

Use a button for a momentary action such as triggering a sound. Its value is 1 while pressed and 0 when released. Its range and initial value are built in.

Basic use

Add the control to the model’s Controls collection during setup.

controls = { Button("Trigger") };

Optional placement and size

Pass Control::Size as the last argument. Its values are x, y, width, and height. Omit it for automatic layout.

controls = { Button("Trigger", { 0, 0, 72, 24 }) };