Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSStatusItemMBS class.

NSStatusItemMBS.Action

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Statusitem MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No
The event called when the user clicks on the statusitem.

Mouse position can be calculated based on System.MouseX/System.MouseY relative to Left/Top. Mouse status can be read using System.MouseDown.

This event is limited. You can't for example do everything like quit an application. For using quit, start a timer which will remove the menu 500ms later and than quit 500ms later.

This event is coming from the Cocoa event system. What you can do is a bit limited when using GUI functions from Xojo. To avoid some redraw errors, you may want to start a timer and let your Xojo 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 Xojo code modifies some global Cocoa states.

NSStatusItemMBS.DoubleAction

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Statusitem MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No
The event called when the user double clicks on the statusitem.

If two Action Events happen very fast, this one is called the second time so you can e.g. react on double clicks.
Mouse position can be calculated based on System.MouseX/System.MouseY relative to Left/Top. Mouse status can be read using System.MouseDown.

This event is coming from the Cocoa event system. What you can do is a bit limited when using GUI functions from Xojo. To avoid some redraw errors, you may want to start a timer and let your Xojo 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 Xojo code modifies some global Cocoa states.

Some examples using this event:

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


The biggest plugin in space...