1

I am developing an OS X app That uses StatusBar and Also has Windows I would to move my app to "background" (That only StatusBar will be shown and windows ofc and not applications main menu) When all it's windows are closed. (I want to do it so, the app won't appear in cmd+tab menu etc, I want only StatusBar to be).

I am quite don't know where in documents to look for it and if it is even possible.

I have found that in Info.Plist I can put a flag to enable "LSBackgroundOnly" - then I see only my StatusBar.

But I want to switch between background and foreground, Since I want to allow my user to open the main Application Window via the StatusBar menu as well.

What would be the best approach or where to look for this ?

Coldsteel48
  • 3,482
  • 4
  • 26
  • 43
  • possible duplicate of [How to display application icon in menubar even application is quit](http://stackoverflow.com/questions/24088906/how-to-display-application-icon-in-menubar-even-application-is-quit) – stevesliva May 30 '15 at 03:20

1 Answers1

1

Sorry to flag as a possible duplicate. The other question doesn't exactly have good keywords for searching, but the answer is the same:

Use or modify the code in the answer here.

The info.plist settings are or OSX versions before 10.9 and cannot be changed at runtime. 10.9+ you can use NSApplication's setActivationPolicy and application delegate functions to do what you want. See discussion here and here as well.

Community
  • 1
  • 1
stevesliva
  • 5,351
  • 1
  • 16
  • 39
  • Thank you very much ! this is exactly what I need. Sorry fir making duplicate question , I didnt find the answer for 2 days, also didnt know it is even possible, so I asked. Thank you again ! – Coldsteel48 May 30 '15 at 10:33