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

Language Guide / Controls and Parameters · Generated API signature

Menu

klang::Menu

Creates a choice control.

List the option labels in display order. The control reports the zero-based index and starts on the first option. To start elsewhere, set the control to the desired index during setup.

Basic use

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

controls = { Menu("Shape", "Sine", "Saw") };

Optional placement and size

Pass Control::Size immediately after the label, before the options. Its values are x, y, width, and height. Omit it for automatic layout.

controls = { Menu("Shape", { 0, 0, 110, 24 }, "Sine", "Saw") };