I’m trying to use SystemTrayIconComponent
from an existing native macOS/Windows application. When using SystemTrayIconComponent::showDropdownMenu()
from the mouseDown()
handler I get an assertion error like the one in this thread: BR: juce::SystemTrayIconComponent::showDropdownMen () doesn't appear to work
Calling MenuBarModel::setMacMainMenu()
with a dummy menu as a workaround let’s me use SystemTrayIconComponent::showDropdownMenu()
but also completely wipes the existing main menu bar.
I was wondering if anyone has found a good solution to this? I don’t really understand why displaying a menu locally on the status menu bar needs to fiddle with the main menu bar, but I imagine there are good reasons. Ideally, SystemTrayIconComponent
would be able to use the menu
property on NSStatusItem
. This would also make the menu appear similarly to other status bar items.
Also, I’ve just discovered that the SystemTrayIconComponent::showDropdownMenu()
method is macOS only – does this mean that there is no way to get a menu on the tray icon on Windows?