zng_wgt_menu::sub

Trait SubMenuWidgetInfoExt

Source
pub trait SubMenuWidgetInfoExt {
    // Required methods
    fn is_submenu(&self) -> bool;
    fn is_submenu_open(&self) -> Option<ReadOnlyArcVar<bool>>;
    fn submenu_parent(&self) -> Option<WidgetInfo>;
    fn submenu_ancestors(&self) -> SubMenuAncestors ;
    fn submenu_self_and_ancestors(&self) -> SubMenuAncestors ;
    fn submenu_root(&self) -> Option<WidgetInfo>;
    fn menu(&self) -> Option<WidgetInfo>;
}
Expand description

Extension methods for WidgetInfo.

Required Methods§

Source

fn is_submenu(&self) -> bool

If this widget is a SubMenu! instance.

Source

fn is_submenu_open(&self) -> Option<ReadOnlyArcVar<bool>>

Gets a variable that tracks if the sub-menu is open.

Source

fn submenu_parent(&self) -> Option<WidgetInfo>

Gets the sub-menu that spawned self if is_submenu, otherwise returns the first ancestor that is sub-menu.

Note that the returned widget may not be an actual parent in the info-tree as sub-menus use popups to present their sub-menus.

Source

fn submenu_ancestors(&self) -> SubMenuAncestors

Gets an iterator over sub-menu parents until root.

Source

fn submenu_self_and_ancestors(&self) -> SubMenuAncestors

Gets an iterator over the widget, if it is a sub-menu, and sub-menu parents until root.

Source

fn submenu_root(&self) -> Option<WidgetInfo>

Gets the last submenu ancestor.

Source

fn menu(&self) -> Option<WidgetInfo>

Gets the alt-scope parent of the root_submenu.

This is None if the widget is inside a context menu or not inside.

Implementations on Foreign Types§

Source§

impl SubMenuWidgetInfoExt for WidgetInfo

Implementors§