Struct cursive::views::MenuPopup
[−]
[src]
pub struct MenuPopup { /* fields omitted */ }
Popup that shows a list of items.
Methods
impl MenuPopup
[src]
fn new(menu: Rc<MenuTree>) -> Self
[src]
Creates a new MenuPopup
using the given menu tree.
fn set_focus(&mut self, focus: usize)
[src]
Sets the currently focused element.
fn focus(self, focus: usize) -> Self
[src]
Sets the currently focused element.
Chainable variant.
fn align(self, align: Align) -> Self
[src]
Sets the alignment for this view.
Chainable variant.
fn set_align(&mut self, align: Align)
[src]
Sets the alignment for this view.
fn on_dismiss<F: 'static + Fn(&mut Cursive)>(self, f: F) -> Self
[src]
Sets a callback to be used when this view is actively dismissed.
(When the user hits
Chainable variant.
fn set_on_dismiss<F: 'static + Fn(&mut Cursive)>(&mut self, f: F)
[src]
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
[src]
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.
Chainable variant.
fn set_on_action<F: 'static + Fn(&mut Cursive)>(&mut self, f: F)
[src]
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(&self, printer: &Printer)
[src]
Draws the view with the given printer (includes bounds) and focus.
fn required_size(&mut self, req: Vec2) -> Vec2
[src]
Returns the minimum size the view requires with the given restrictions. Read more
fn on_event(&mut self, event: Event) -> EventResult
[src]
Called when a key was pressed. Read more
fn layout(&mut self, size: Vec2)
[src]
Called once the size for this view has been decided, Read more
fn needs_relayout(&self) -> bool
[src]
Returns true
if the view content changed since last layout phase. Read more
fn call_on_any<'a>(&mut self, _: &Selector, _: Box<FnMut(&mut Any) + 'a>)
[src]
Runs a closure on the view identified by the given selector. Read more
fn focus_view(&mut self, &Selector) -> Result<(), ()>
[src]
Moves the focus to the view identified by the given selector. Read more
fn take_focus(&mut self, source: Direction) -> bool
[src]
This view is offered focus. Will it take it? Read more