Reputation: 951
I have a status bar OS X application that has a NSWindow which displays a minimal UI. I want the window to hide automatically (may be using NSTimer) if the user is not interacting with the app.
NSWindow can be hidden using orderOut or setVisible methods but how can I make sure that user is not doing anything critical or interacting with the app Or even the app is not doing some UI updates before it is made hidden?
Do I need to override NSWindow?
Any help would be appreciable.
Upvotes: 1
Views: 127
Reputation: 36295
Implement the windowDidResignKey
method of the window delegate. So you know it's no longer key and you can close it.
Upvotes: 1