PDA

View Full Version : NSWindow HideOnDeactivate - event




kwicher
May 15, 2012, 08:12 PM
Hi

How do you detect that NSWindow lost focus and got hidden due to the HideOnDeactivate set to TRUE?

THanks

K



Sydde
May 15, 2012, 10: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.

kwicher
May 16, 2012, 03: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.
Thanks
K

knightlie
May 16, 2012, 04: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.