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.
- Radio
State - Widget state.
- Radio
Style - Composite style.
Enums§
- Radio
Layout - 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.