View Full Version : NSWindow HideOnDeactivate - event
May 15, 2012, 09:12 PM
How do you detect that NSWindow lost focus and got hidden due to the HideOnDeactivate set to TRUE?
May 15, 2012, 11:18 PM
Do you know how to use delegate methods? Note that hideOnDeactivate means that the application itself is dropping back behind another one, so you could either use a window delegate method or notification or an app delegate or notification. Refer to the guides and documentation to learn how to handle this.
May 16, 2012, 04:22 AM
I know how to delegate etc but what message is sent to when the window disappears? It is not hidden because a simple test will show you that isVisible=TRUE.
May 16, 2012, 05:05 AM
I'm not sure if it's what you are after, but the NSApplicationDelegate protocol has an applicationDidResignActive: method which is called when your app loses focus. There's also the [NSApplication isActive] method - if the app is inactive then you can infer that a window which is set to HideOnDeactivate is probably hidden.