NSWindow HideOnDeactivate - event

Discussion in 'Mac Programming' started by kwicher, May 15, 2012.

  1. kwicher macrumors newbie

    May 15, 2012

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


  2. Sydde macrumors 68020


    Aug 17, 2009
    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.
  3. kwicher thread starter macrumors newbie

    May 15, 2012
    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.
  4. knightlie macrumors 6502a

    Feb 18, 2008
    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.

Share This Page