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

Language Guide / Controls and Parameters · Generated API signature

Slider

klang::Slider

Creates a slider.

Use a slider for a continuous value such as a wet/dry mix. The optional minimum, maximum, and initial value default to 0, 1, and 0.

Basic use

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

controls = { Slider("Mix") };

Optional properties

Pass the minimum, maximum, and initial value to set the range and starting position. This mix slider starts halfway through its range.

controls = { Slider("Mix", 0, 1, 0.5) };

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 = { Slider("Mix", 0, 1, 0.5, { 0, 0, 120, 24 }) };