Trait NSMenuDelegate

Source
pub unsafe trait NSMenuDelegate: NSObjectProtocol + MainThreadOnly {
    // Provided methods
    unsafe fn menuNeedsUpdate(&self, menu: &NSMenu)
       where Self: Sized + Message { ... }
    unsafe fn numberOfItemsInMenu(&self, menu: &NSMenu) -> NSInteger
       where Self: Sized + Message { ... }
    unsafe fn menu_updateItem_atIndex_shouldCancel(
        &self,
        menu: &NSMenu,
        item: &NSMenuItem,
        index: NSInteger,
        should_cancel: bool,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn menuWillOpen(&self, menu: &NSMenu)
       where Self: Sized + Message { ... }
    unsafe fn menuDidClose(&self, menu: &NSMenu)
       where Self: Sized + Message { ... }
    unsafe fn menu_willHighlightItem(
        &self,
        menu: &NSMenu,
        item: Option<&NSMenuItem>,
    )
       where Self: Sized + Message { ... }
    unsafe fn confinementRectForMenu_onScreen(
        &self,
        menu: &NSMenu,
        screen: Option<&NSScreen>,
    ) -> NSRect
       where Self: Sized + Message { ... }
}
Available on crate feature NSMenu only.
Expand description

Provided Methods§

Source

unsafe fn menuNeedsUpdate(&self, menu: &NSMenu)
where Self: Sized + Message,

Source

unsafe fn numberOfItemsInMenu(&self, menu: &NSMenu) -> NSInteger
where Self: Sized + Message,

Source

unsafe fn menu_updateItem_atIndex_shouldCancel( &self, menu: &NSMenu, item: &NSMenuItem, index: NSInteger, should_cancel: bool, ) -> bool
where Self: Sized + Message,

Available on crate feature NSMenuItem only.
Source

unsafe fn menuWillOpen(&self, menu: &NSMenu)
where Self: Sized + Message,

Source

unsafe fn menuDidClose(&self, menu: &NSMenu)
where Self: Sized + Message,

Source

unsafe fn menu_willHighlightItem( &self, menu: &NSMenu, item: Option<&NSMenuItem>, )
where Self: Sized + Message,

Available on crate feature NSMenuItem only.
Source

unsafe fn confinementRectForMenu_onScreen( &self, menu: &NSMenu, screen: Option<&NSScreen>, ) -> NSRect
where Self: Sized + Message,

Available on crate feature NSScreen only.

Trait Implementations§

Source§

impl ProtocolType for dyn NSMenuDelegate

Source§

const NAME: &'static str = "NSMenuDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn NSMenuDelegate

Implementations on Foreign Types§

Source§

impl<T> NSMenuDelegate for ProtocolObject<T>
where T: ?Sized + NSMenuDelegate,

Implementors§