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

pub struct MenuPopup { /* fields omitted */ }

Popup that shows a list of items.

This is mostly used indirectly when creating a popup SelectView or a menubar.

Implementations

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 Scroller for MenuPopup[src]

impl View for MenuPopup[src]

Auto Trait Implementations

impl !RefUnwindSafe for MenuPopup

impl !Send for MenuPopup

impl !Sync for MenuPopup

impl Unpin for MenuPopup

impl !UnwindSafe for MenuPopup

Blanket Implementations

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

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

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

impl<T> Erased for T[src]

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.