How to add to the Dock or Application menu?


#1

I’ve just started using the system tray component for my application on Windows, and that works great. It was easy to program, and works like a dream. Now, I’d like the Mac side to do something similar.

Idea #1: The dock is a bit like the system tray. It’s a handy place for users to find my application’s icon, and a right click shows a menu of things they could do with the application. Is there a way to modifiy this menu in juce so other functionality could be added, as the system tray does on windows, or iTunes does on the mac?

Idea #2: If I can’t change the menu in the dock, how about a global application menu (rather than a menu at the top of each window) that would allow the user to open one of two types of windows, or handle global settings without opening a window.

I’m simply trying to separate out device settings from the main GUI, so the user has quick access to changing sample rate, for instance, without having to open a full GUI window. Any other ideas?


#2

No bites?

OK, I’ll follow up my own post after doing some research:

The dock menu is really called the Dock Tile menu. Items can be manipulated using GetApplicationDockTileMenu() and SetApplicationDockTileMenu().

Events from the dock tile menu can be handled in juce_mac_messaging::AppEventHandlerProc() by handling a kEventClassApplication event (which is already handled!) with an event kind of kEventAppGetDockTileMenu

If I could add menu items to this menu, and handle them in my dock, I could allow users to change hardware settings without opening up my full interface, just like system tray menus can do on windows.

I see that not even tracktion has more than a single menu item in the menu bar. What’s the reasoning behind this design decision?


#3

It’s not a design decision, I’ve just never written a wrapper for the dock icon management stuff…


#4