[−][src]Struct cursive::views::MenuPopup
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 draw(&self, printer: &Printer)
[src]
fn required_size(&mut self, req: Vec2) -> Vec2
[src]
fn on_event(&mut self, event: Event) -> EventResult
[src]
fn layout(&mut self, size: Vec2)
[src]
fn important_area(&self, size: Vec2) -> Rect
[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]
fn get_scroller(&self) -> &Core
[src]
fn get_scroller_mut(&mut self) -> &mut Core
[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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,