Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set a menubar icon on mac osx using wx

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.

like image 652
Dprado Avatar asked Sep 28 '08 14:09

Dprado


People also ask

How do you customize the menu bar on a Mac?

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 .

How do I remove items from my Mac 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.


2 Answers

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.

like image 191
Sören Kuklau Avatar answered Dec 18 '22 12:12

Sören Kuklau


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.

like image 39
Rabarberski Avatar answered Dec 18 '22 12:12

Rabarberski