Struct cursive::view::MenuPopup
[−]
[src]
pub struct MenuPopup { // some fields omitted }
Popup that shows a list of items.
Methods
impl MenuPopup
[src]
fn new(menu: Rc<MenuTree>) -> Self
Creates a new MenuPopup
using the given menu tree.
fn align(self, align: Align) -> Self
Sets the alignment for this view.
fn on_dismiss<F: 'static + Fn(&mut Cursive)>(self, f: F) -> Self
Sets a callback to be used when this view is actively dismissed.
(When the user hits
fn on_action<F: 'static + Fn(&mut Cursive)>(self, f: F) -> Self
Sets a callback to be used when a leaf is activated.
Will also be called if a leaf from a subtree is activated.
Usually used to hide the parent view.
Trait Implementations
impl View for MenuPopup
[src]
fn draw(&mut self, printer: &Printer)
Draws the view with the given printer (includes bounds) and focus.
fn get_min_size(&mut self, req: Vec2) -> Vec2
Returns the minimum size the view requires with the given restrictions.
fn on_event(&mut self, event: Event) -> EventResult
Called when a key was pressed. Default implementation just ignores it.
fn layout(&mut self, size: Vec2)
Called once the size for this view has been decided, Read more
fn needs_relayout(&self) -> bool
Returns true
if the view content changed since last layout phase. Read more
fn find(&mut self, &Selector) -> Option<&mut Any>
Finds the view pointed to by the given path. Read more
fn take_focus(&mut self, source: Direction) -> bool
This view is offered focus. Will it take it? Read more