Expand description
Choice/Select widget.
use rat_popup::Placement;
use rat_scrolled::Scroll;
use rat_widget::choice::{Choice, ChoiceState};
let (widget, popup) = Choice::new()
.item("Carrots")
.item("Potatoes")
.item("Onions")
.item("Peas")
.item("Beans")
.item("Tomatoes")
.popup_block(Block::bordered())
.popup_placement(Placement::AboveOrBelow)
.popup_boundary(max_bounds)
.into_widgets();
widget.render(Rect::new(3,3,15,1), &mut buf, &mut cstate);
// ... render other widgets
popup.render(Rect::new(3,3,15,1), &mut buf, &mut cstate);
Structs§
- Choice.
- Renders the popup. This is called after the rest of the area is rendered and overwrites to display itself.
- State.
- Combined style.
- Renders the main widget.
Functions§
- Handle all events. Text events are only processed if focus is true. Mouse events are processed if they are in range.
- Handle only mouse-events.
- Handle events for the popup. Call before other handlers to deal with intersections with other widgets.