Skip to main content

NSMenuDelegate

Trait NSMenuDelegate 

Source
pub unsafe trait NSMenuDelegate: NSObjectProtocol + MainThreadOnly {
    // Provided methods
    fn menuNeedsUpdate(&self, menu: &NSMenu)
       where Self: Sized + Message { ... }
    fn numberOfItemsInMenu(&self, menu: &NSMenu) -> NSInteger
       where Self: Sized + Message { ... }
    fn menu_updateItem_atIndex_shouldCancel(
        &self,
        menu: &NSMenu,
        item: &NSMenuItem,
        index: NSInteger,
        should_cancel: bool,
    ) -> bool
       where Self: Sized + Message { ... }
    fn menuWillOpen(&self, menu: &NSMenu)
       where Self: Sized + Message { ... }
    fn menuDidClose(&self, menu: &NSMenu)
       where Self: Sized + Message { ... }
    fn menu_willHighlightItem(&self, menu: &NSMenu, item: Option<&NSMenuItem>)
       where Self: Sized + Message { ... }
    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

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

Source

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

Source

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

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

Source

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

Source

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

Available on crate feature NSMenuItem only.
Source

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

Available on crate feature NSScreen only.

Trait Implementations§

Source§

impl<T> ImplementedBy<T> for dyn NSMenuDelegate

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

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

Implementors§