I could not find any pointers on how to create a menubar icon on OSX using wx. I originally thought that the wxTaskBarIcon class would do, but it actually creates an icon on the Dock. On Windows, wxTaskBarIcon creates a Systray icon and associated menu, and I would think that on mac osx it would create a menubar icon, I guess not.
On your Mac, use Dock & Menu Bar System Preferences to change the appearance of the Dock, and to select items to show in the menu bar and in Control Center. To change these preferences, choose Apple menu > System Preferences, then click Dock & Menu Bar .
Hold down the Cmd key. Click and hold the menu bar icon you want to remove and drag it off of the menu bar. Release the mouse once you see the X symbol.
You have to set wxTaskBarIconType
to STATUSITEM
, not DOCK
. The Cocoa APIs for this are NSStatusBar
and NSStatusItem
; here's the code in wxWidgets that calls to them.
This post by Robin Dunn, the creator of wxPython, explains that wxPython doesn't support menubar icons on mac yet. They only support the Dock.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With