pub trait ContextMenuItemExt: 'static {
    fn gaction(&self) -> Option<Action>;
    fn stock_action(&self) -> ContextMenuAction;
    fn submenu(&self) -> Option<ContextMenu>;
    fn is_separator(&self) -> bool;
    fn set_submenu(&self, submenu: Option<&impl IsA<ContextMenu>>);
}
Expand description

Trait containing all ContextMenuItem methods.

Implementors

ContextMenuItem

Required Methods

Available on crate feature v2_18 only.

Gets the action associated to self as a gio::Action.

Returns

the gio::Action associated to the ContextMenuItem, or None if self is a separator.

Gets the ContextMenuAction of self.

If the ContextMenuItem was not created for a stock action ContextMenuAction::Custom will be returned. If the ContextMenuItem is a separator ContextMenuAction::NoAction will be returned.

Returns

the ContextMenuAction of self

Gets the submenu of self.

Returns

the ContextMenu representing the submenu of self or None if self doesn’t have a submenu.

Checks whether self is a separator.

Returns

true is self is a separator or false otherwise

Sets or replaces the self submenu.

If submenu is None the current submenu of self is removed.

a ContextMenu

Implementors