NSWindow HideOnDeactivate - event

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

  1. kwicher
    Expand Collapse
    macrumors newbie

    Joined:
    May 15, 2012
    #1
    Hi

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

    THanks

    K
     
  2. Sydde
    Expand Collapse
    macrumors 68020

    Sydde

    Joined:
    Aug 17, 2009
    #2
    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
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    May 15, 2012
    #3
    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
     
  4. knightlie
    Expand Collapse
    macrumors 6502a

    Joined:
    Feb 18, 2008
    #4
    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