I’m writing a mac app that sits in the menu bar and presents the user with a NSPanel instance when they click the status item. I want to hide the window whenever another status item’s menu is opened. Right now, my panel stays open; it looks like this:

I see other applications like mine close when another status item opens its menu, so I’m wonder which notification they’re getting to know to disappear. I’ve looked into NSWindowDelegate and NSApplicationDelegate, but I don’t see any notifications being generated.
Have any suggestions?
I figured it out! In the
awakeFromNib, I was setting the properties of myNSPanelinstance. I was using the following:Switching it to the following:
Did the trick. I figured it out after reading Neil Inglis’ blog post on using MAAttachedWindow in a similar way.