Module button

Source
Expand description

Button widget.

Render:

Button::new("Button")
     .styles(THEME.button_style()) //
     .render(b_area_1, frame.buffer_mut(), &mut state.button1);

Event handling:

match state.button1.handle(event, Regular) {
    ButtonOutcome::Pressed => {
        data.p1 += 1;
        Outcome::Changed
    }
    r => r.into(),
}

Structs§

Button
Button widget.
ButtonState
State & event-handling.
ButtonStyle
Composite style.

Functions§

handle_events
Handle all events. Text events are only processed if focus is true. Mouse events are processed if they are in range.
handle_mouse_events
Handle only mouse-events.