Skip to main content

INSMenu

Trait INSMenu 

Source
pub trait INSMenu: PNSObject {
    // Provided methods
    fn m_menu_bar_visible() -> bool { ... }
    fn m_set_menu_bar_visible(visible: bool) { ... }
    fn p_menu_bar_height(&self) -> CGFloat { ... }
    fn m_init_with_title(title: NSString) -> Self
       where Self: Sized + FromId { ... }
    fn m_insert_item_at_index(&mut self, new_item: NSMenuItem, index: Int) { ... }
    fn m_insert_item_with_title_action_key_equivalent_at_index(
        &mut self,
        string: NSString,
        sel: Sel,
        char_code: NSString,
        index: Int,
    ) -> NSMenuItem { ... }
    fn m_add_item(&mut self, new_item: NSMenuItem) { ... }
    fn m_add_item_with_title_action_key_equivalent(
        &mut self,
        title: NSString,
        sel: Sel,
        char_code: NSString,
    ) -> NSMenuItem { ... }
    fn m_remove_item(&mut self, item: NSMenuItem) { ... }
    fn m_remove_item_at_index(&mut self, index: Int) { ... }
    fn m_remove_all_items(&mut self) { ... }
}
Expand description

A trait containing all the methods for NSMenu

Provided Methods§

Source

fn m_menu_bar_visible() -> bool

Returns a Boolean value that indicates whether the menu bar is visible.

Source

fn m_set_menu_bar_visible(visible: bool)

Sets whether the menu bar is visible and selectable by the user.

Source

fn p_menu_bar_height(&self) -> CGFloat

The menu bar height for the main menu in pixels.

Source

fn m_init_with_title(title: NSString) -> Self
where Self: Sized + FromId,

Initializes and returns a menu having the specified title and with autoenabling of menu items turned on.

Source

fn m_insert_item_at_index(&mut self, new_item: NSMenuItem, index: Int)

Inserts a menu item into the menu at a specific location.

Source

fn m_insert_item_with_title_action_key_equivalent_at_index( &mut self, string: NSString, sel: Sel, char_code: NSString, index: Int, ) -> NSMenuItem

Creates and adds a menu item at a specified location in the menu.

Source

fn m_add_item(&mut self, new_item: NSMenuItem)

Adds a menu item to the end of the menu.

Source

fn m_add_item_with_title_action_key_equivalent( &mut self, title: NSString, sel: Sel, char_code: NSString, ) -> NSMenuItem

Creates a new menu item and adds it to the end of the menu.

Source

fn m_remove_item(&mut self, item: NSMenuItem)

Removes a menu item from the menu.

Source

fn m_remove_item_at_index(&mut self, index: Int)

Removes the menu item at a specified location in the menu.

Source

fn m_remove_all_items(&mut self)

Removes all the menu items in the menu.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§