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(1, "Carrots")
.item(2, "Potatoes")
.item(3, "Onions")
.item(4, "Peas")
.item(5, "Beans")
.item(6, "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);
Modules§
Structs§
- Choice
- Choice.
- Choice
Popup - Renders the popup. This is called after the rest of the area is rendered and overwrites to display itself.
- Choice
State - State.
- Choice
Style - Combined style.
- Choice
Widget - Renders the main widget.
Enums§
- Choice
Close - Enum controlling the behaviour of the Choice.
- Choice
Focus - Enum controling the behaviour of the Choice.
- Choice
Select - Enum controling the behaviour of the Choice.
Functions§
- handle_
events - Handle events for the popup. Call before other handlers to deal with intersections with other widgets.
- handle_
mouse_ events - Handle only mouse-events.