Module choice

Module choice 

Source
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§

core

Structs§

Choice
Choice.
ChoicePopup
Renders the popup. This is called after the rest of the area is rendered and overwrites to display itself.
ChoiceState
State.
ChoiceStyle
Combined style.
ChoiceWidget
Renders the main widget.

Enums§

ChoiceClose
Enum controlling the behaviour of the Choice.
ChoiceFocus
Enum controling the behaviour of the Choice.
ChoiceSelect
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.