[−][src]Struct cursive_core::views::MenuPopup
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]
pub fn get_scroller_mut(&mut self) -> &mut Core[src]
pub fn get_scroller(&self) -> &Core[src]
impl View for MenuPopup[src]
pub fn draw(&self, printer: &Printer<'_, '_>)[src]
pub fn required_size(&mut self, req: Vec2) -> Vec2[src]
pub fn on_event(&mut self, event: Event) -> EventResult[src]
pub fn layout(&mut self, size: Vec2)[src]
pub fn important_area(&self, size: Vec2) -> Rect[src]
pub fn needs_relayout(&self) -> bool[src]
pub fn call_on_any<'a>(&mut self, _: &Selector<'_>, _: AnyCb<'a>)[src]
pub fn focus_view(&mut self, _: &Selector<'_>) -> Result<(), ()>[src]
pub fn take_focus(&mut self, source: Direction) -> bool[src]
pub fn type_name(&self) -> &'static str[src]
Auto Trait Implementations
impl !RefUnwindSafe for MenuPopup[src]
impl !Send for MenuPopup[src]
impl !Sync for MenuPopup[src]
impl Unpin for MenuPopup[src]
impl !UnwindSafe for MenuPopup[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[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]
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.
pub 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>,