[][src]Struct cursive::views::MenuPopup

pub struct MenuPopup { /* fields omitted */ }

Popup that shows a list of items.

Methods

impl MenuPopup[src]

pub fn new(menu: Rc<MenuTree>) -> Self[src]

Creates a new MenuPopup using the given menu tree.

pub fn set_focus(&mut self, focus: usize)[src]

Sets the currently focused element.

pub fn focus(self, focus: usize) -> Self[src]

Sets the currently focused element.

Chainable variant.

pub fn get_focus(&self) -> usize[src]

Returns the position of the currently focused child.

pub fn align(self, align: Align) -> Self[src]

Sets the alignment for this view.

Chainable variant.

pub fn set_align(&mut self, align: Align)[src]

Sets the alignment for this view.

pub 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.

pub 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 )

pub 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.

pub 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 needs_relayout(&self) -> bool[src]

Should return true if the view content changed since the last call to layout(). Read more

fn call_on_any<'a>(&mut self, _: &Selector, _: AnyCb<'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

impl Scroller for MenuPopup[src]

Auto Trait Implementations

impl !Sync for MenuPopup

impl !Send for MenuPopup

impl Unpin for MenuPopup

impl !RefUnwindSafe for MenuPopup

impl !UnwindSafe for MenuPopup

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]