tray_icon::menu

Trait ContextMenu

Source
pub trait ContextMenu {
    // Required methods
    fn show_context_menu_for_gtk_window(
        &self,
        w: &Window,
        position: Option<Position>,
    );
    fn gtk_context_menu(&self) -> Menu;
}
Expand description

A helper trait with methods to help creating a context menu.

Required Methods§

Source

fn show_context_menu_for_gtk_window( &self, w: &Window, position: Option<Position>, )

Shows this menu as a context menu inside a gtk::Window

  • position is relative to the window top-left corner, if None, the cursor position is used.
Source

fn gtk_context_menu(&self) -> Menu

Get the underlying gtk menu reserved for context menus.

The returned gtk::Menu is valid as long as the ContextMenu is.

Implementors§