Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kwicher

macrumors newbie
Original poster
May 15, 2012
2
0
Hi

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

THanks

K
 
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.
 
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
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.