Platforms to show: All Mac Windows Linux Cross-Platform

NSStatusItemMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Statusitem MBS MacCocoa Plugin 7.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A class to handle a NSStatusitem which is a tiny little item in the menu bar.
Example
// show an icon in the menu bar and react to clicks
// MyStatusItem is a subclass of NSStatusItemMBS with the Action event implemented.
// StatusItem is a property of the app: StatusItem As MyStatusItem
StatusItem = New MyStatusItem
If StatusItem.CreateMenu Then
StatusItem.image = NSImageMBS.imageWithSystemSymbolName("bolt.fill", "MyApp")
End If

// in MyStatusItem:
Sub Action() Handles Action
System.DebugLog "Menu bar icon clicked."
End Sub

All methods in this class will catch exceptions from Cocoa and raise a NSExceptionMBS instead. Using the message, name and reason properties you can see what was the reason for this exception. Please report if you find a method which does not handle exceptions correct.

This class has no subclasses.

Blog Entries

Xojo Developer Magazine

Release notes

Some examples using this class:

Some related classes:


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


NSStatusBarButtonMBS   -   NSStepperMBS


The biggest plugin in space...