pub fn knob(value: impl Binding<f32>) -> impl View
Expand description
Knob for controlling a 0 to 1 floating point parameter.
Examples found in repository?
More examples
examples/knob.rs (line 15)
8 9 10 11 12 13 14 15 16 17 18 19
fn main() {
rui(state(MyState::default, |state, cx| {
vstack((
format!("value: {:?}", cx[state]).padding(Auto),
map(
cx[state].x * 0.01,
move |v, cx| cx[state].x = v * 100.0,
|s, _| knob(s).padding(Auto),
),
))
}));
}