Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

NSMenuItemMBS.Constructor(Handle as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa Menus MBS MacBase Plugin 15.2 Yes No No Yes, macOS only No
Function: Constructor for creating an instanced based on an existing handle.
Example:
dim m as MenuItem = EditCopy
dim h as Integer = m.Handle(MenuItem.HandleType.CocoaNSMenuItem)
dim i as new NSMenuItemMBS(h)

i.Title = "Hello"
Notes:
Useful if you get a NSMenuItem reference from a declare.
The object is retained.

See also:

Feedback, Comments & Corrections

NSMenuItemMBS.Constructor(MenuItem as MenuItem)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa Menus MBS MacBase Plugin 18.3 Yes No No No No
Function: Creates a new NSMenuItemMBS object for a given MenuItem.
Example:
dim FileDot, FileDiamond as MenuItem

FileDot.enable
FileDot.checked = true

// via constructor
dim n1 as new NSMenuItemMBS(fileDot)
n1.onStateImage = NSImageMBS.imageNamed("NSMenuItemBullet")

FileDiamond.enable
FileDiamond.checked = true

// via function
dim n2 as NSMenuItemMBS = NSMenuItemMBS.MenuItem(FileDiamond)
n2.onStateImage = NSImageMBS.imageNamed("NSMenuItemDiamond")
Notes: May raise UnsupportedOperationException or NilObjectException if used incorrectly.

See also:

Feedback, Comments & Corrections

NSMenuItemMBS.Constructor(title as string="", keyEquivalent as string="")
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa Menus MBS MacBase Plugin 15.2 Yes No No Yes, macOS only No
Function: Creates a new menu items.
Notes:
Handle is not 0 after this call if it was successfull.
name and charcode are optional and can be "".
Charcode is the initial keyEquivalent for this menu item.
You can set the KeyEquivalentModifierMask to get different modifier keys.

See also:

Feedback, Comments & Corrections

NSMenuItemMBS.CreateMenuItem(title as string="", keyEquivalent as string="")
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: Creates a new menu items.
Notes:
Handle is not 0 after this call if it was successfull.
name and charcode are optional and can be "".
Charcode is the initial keyEquivalent for this menu item.
You can set the KeyEquivalentModifierMask to get different modifier keys.

Deprecated, please use the Constructor instead.

Feedback, Comments & Corrections

NSMenuItemMBS.CreateSeparator
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: Creates a Separator menu item.

Feedback, Comments & Corrections

NSMenuItemMBS.setTitleWithMnemonic(title as String)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa Menus MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Sets the title of a menu item with a character denoting an access key.
Notes:
Use an ampersand character to mark the character (the one following the ampersand) to be designated.
Deprecated by Apple.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacBase Plugin.





Links
MBS Xojo Chart Plugins