pub struct ContextMenuHandle { /* private fields */ }Expand description
Opens a ContextMenu from code, at a point. For a trigger that decides
for itself when a menu is asked for, such as a canvas that pans with the
right button and wants a menu only for a right-click that does not drag:
it handles the press, and opens the menu with Self::open_at.
Implementations§
Source§impl ContextMenuHandle
impl ContextMenuHandle
pub fn new() -> Self
Sourcepub fn open_at(&self, ctx: &mut EventCtx, position: Point) -> bool
pub fn open_at(&self, ctx: &mut EventCtx, position: Point) -> bool
Open the menu at position, in window coordinates, once the current
event is handled; if it is open, it moves there. The menu’s items are
read again, so a provider given with ContextMenu::items_when can
list what applies where it opened. If the widget handling the event
has focus, the menu gives focus back to it when it closes, unless a
click elsewhere closes it. Returns false if the menu has not been
laid out yet.
Trait Implementations§
Source§impl Clone for ContextMenuHandle
impl Clone for ContextMenuHandle
Auto Trait Implementations§
impl !RefUnwindSafe for ContextMenuHandle
impl !Send for ContextMenuHandle
impl !Sync for ContextMenuHandle
impl !UnwindSafe for ContextMenuHandle
impl Forget for ContextMenuHandle
impl Freeze for ContextMenuHandle
impl Move for ContextMenuHandle
impl Unpin for ContextMenuHandle
impl UnsafeUnpin for ContextMenuHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more