Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

NSMenuItemMBS.Action
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
event Cocoa Menus MBS MacBase Plugin 7.2 Yes No No No No
Function: The action event called when the user clicks on the statusitem.
Notes:
This event is coming from the Cocoa event system. What you can do is a bit limited when using GUI functions from Realbasic. To avoid some redraw errors, you may want to start a timer and let your Realbasic code run a millisecond after the menu code has finished.
Depending on what you do, you can see the menu not redrawing properly (staying highlighted) and crashes if the Realbasic code modifies some global Cocoa states.

Feedback, Comments & Corrections

NSMenuItemMBS.validateMenuItem(menuItem as NSMenuItemMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
event Cocoa Menus MBS MacBase Plugin 13.1 Yes No No No No
Function: Implemented to override the default action of enabling or disabling a specific menu item.
Notes:
Return true to enable menuItem, false to disable it.
This is needed to modify the menuitem for a menu attached to a NSSearchFieldMBS.
Menuitem parameter is often the same as self, but for a searchfield menu, self is the template and menuitem parameter the actual menu item.

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins