pub trait ContextMenu {
// Required methods
unsafe fn show_context_menu_for_nsview(
&self,
view: *const c_void,
position: Option<Position>,
);
fn ns_menu(&self) -> *mut c_void;
}
Expand description
A helper trait with methods to help creating a context menu.
Required Methods§
Shows this menu as a context menu for the specified NSView
.
position
is relative to the window top-left corner, ifNone
, the cursor position is used.
§Safety
The view must be a pointer to a valid NSView
.
Get the underlying NSMenu reserved for context menus.
The returned pointer is valid for as long as the ContextMenu
is. If
you need it to be alive for longer, retain it.