ContextMenu

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§