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§
Returns a Boolean value that indicates whether the menu bar is visible.
Sets whether the menu bar is visible and selectable by the user.
The menu bar height for the main menu in pixels.
Sourcefn m_init_with_title(title: NSString) -> Self
fn m_init_with_title(title: NSString) -> Self
Initializes and returns a menu having the specified title and with autoenabling of menu items turned on.
Sourcefn m_insert_item_at_index(&mut self, new_item: NSMenuItem, index: Int)
fn m_insert_item_at_index(&mut self, new_item: NSMenuItem, index: Int)
Inserts a menu item into the menu at a specific location.
Sourcefn m_insert_item_with_title_action_key_equivalent_at_index(
&mut self,
string: NSString,
sel: Sel,
char_code: NSString,
index: Int,
) -> NSMenuItem
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.
Sourcefn m_add_item(&mut self, new_item: NSMenuItem)
fn m_add_item(&mut self, new_item: NSMenuItem)
Adds a menu item to the end of the menu.
Sourcefn m_add_item_with_title_action_key_equivalent(
&mut self,
title: NSString,
sel: Sel,
char_code: NSString,
) -> NSMenuItem
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.
Sourcefn m_remove_item(&mut self, item: NSMenuItem)
fn m_remove_item(&mut self, item: NSMenuItem)
Removes a menu item from the menu.
Sourcefn m_remove_item_at_index(&mut self, index: Int)
fn m_remove_item_at_index(&mut self, index: Int)
Removes the menu item at a specified location in the menu.
Sourcefn m_remove_all_items(&mut self)
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", so this trait is not object safe.