Reputation: 161
In my cocoa app, I have a main window to display main content. Also there's a status item in system status bar (top right) to receive event after the main window is closed.
When I press cmd+q in my app, the main window and status item all quit. How can I make the status item part keep running?
Upvotes: 0
Views: 409
Reputation: 3389
there are 2 options.
You seperate the normal application with the window and the statusbar.
You only hide the window. You can create a new action (for example called -(IBAction)hideWindow;) and connect it with the "terminate NSMenuItem" in the MainMenu (with Interface builder)
Upvotes: 0
Reputation: 14662
You need to have a different application that shows the status item.
One application would run constantly and show the item.
The other is the principal application, running when you need it.
Upvotes: 2