Button
The Button
widget is probably one of the most essential things in all of the UI making world.
They have an on_pressed
callback that is called when the button is pressed.
Buttons can be used like this:
Button::new(
Text::new("Increase".to_string())
).with_on_pressed(
MaybeSignal::signal(
context.use_signal(
EvalSignal::new(move || {
println!("Pressed");
Update::DRAW
})
)
),
)
For a more complex example, see the counter example.