Module radio

Module radio 

Source
Expand description

Radiobutton widget.

use rat_event::{HandleEvent, Regular};
use rat_widget::event::RadioOutcome;
use rat_widget::radio::{Radio, RadioLayout, RadioState};

Radio::new()
    .direction(Direction::Horizontal)
    .layout(RadioLayout::Stacked)
    .item("C", "🥕Carrots")
    .item("P", "🥔Potatoes")
    .item("O", "🧅Onions")
    .default_value("C")
    .render(area, buf, &mut state.radio1);

 // ...

 match state.radio1.handle(event, Regular){
     RadioOutcome::Value => {
         // value changed ..
     }
     _ => {}
 }

Structs§

Radio
Render a list of radio buttons.
RadioState
Widget state.
RadioStyle
Composite style.

Enums§

RadioLayout
How will the radio items fill the given area.

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.