Trait tauri::menu::ContextMenu

source ·
pub trait ContextMenu: ContextMenuBase + Send + Sync {
    // Required methods
    fn popup<R: Runtime>(&self, window: Window<R>) -> Result<()>;
    fn popup_at<R: Runtime, P: Into<Position>>(
        &self,
        window: Window<R>,
        position: P
    ) -> Result<()>;
}
Available on desktop only.
Expand description

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

§Safety

This trait is ONLY meant to be implemented internally by the crate.

Required Methods§

source

fn popup<R: Runtime>(&self, window: Window<R>) -> Result<()>

Popup this menu as a context menu on the specified window at the cursor position.

source

fn popup_at<R: Runtime, P: Into<Position>>( &self, window: Window<R>, position: P ) -> Result<()>

Popup this menu as a context menu on the specified window at the specified position.

The position is relative to the window’s top-left corner.

Object Safety§

This trait is not object safe.

Implementors§