Has anyone got SystemTrayIconComponent with a dropdown menu working?


#1

has anyone got SystemTrayIconComponent with a dropdown menu working in the right hand side on OSX ?

 

I can get a JUCE type popup to appear but this only works when the app is in focus.  My app window is set to not be in the dock or app switcher

I tried to read all the forum posts related to this but still cannot see a solution anywhere. 

 

I'm also wondering if for App store reasons one might have to use an OSX native dropdown instead of the JUCE one. Native has round bottom,

 

Jules ? 


#2

I just tried this with the demo app, but called removeFromDesktop to get rid of the main window, and it still works AFAICT (?)


#3

yes - but  the Demo app has ( like mine currently ) code in it that brings the Demo app to the front ( because otherwise the problem I mentioned comes into effect )   but the problem with this is tha it breaks Apple HIG guidelines and normal menu bar behaviour - in which clicking on a menu extras icon should leave whatever happens to be the frontmost app window at the time the frontmost one. Switching to our app breaks this.

So in our examples the Xcode window should remain in the foreground. 

I've also noticed that the dropdown in the Demo app doesnt go away when a different extras icon - say Volume - is clicked. 

A secondary issue is that I think i read somewhere that OSX Apps get turned down on the Apple store if the menu bar drop-downs appear not to have the standard Native OSX Cocoa menu look.  

 

I guess theres two ways around that - either tweak the lookandfeels so the appearance is correct - or - as I will be attempting shortly - actually  add  ObjC cocoa code to your SystemTrayIconComponent to display native dropdown menus specifically just for use by SystemTrayIconComponent.  But i will be much slower and inferior in achieving this properly than you guys !. 

( i had to teach  myself Objective C last week for this - just in order to investigate all this and begin to attempt solving all this myself )