Re: find standard about panel


James Walker
 

On Mar 13, 2019, at 8:01 PM, Jon Gotow <gotow@...> wrote:

Well, its class is NSPanel rather than NSWindow - is it sufficient to just hide / show all NSPanels in the app's window list when you're deactivated / activated?

Alternately, you can look at all NSPanels and see if any have an NSTextField subview that has a string value equal to the localized name of your app (which you can just grab from NSApp.accessibilityLabel if you don't want to screw around with NSBundle). That's almost certain to be the About box unless you're putting your app's name in a text control in one of your windows :-) Not pretty, but it'd work without too much overhead.
There are other NSPanels, that’s not sufficient.

What I came up with was to find an array of visible windows before calling orderFrontStandardAboutPanel:, find an array of visible windows afterward, and whatever’s in the second list but not the first must be the About panel.

Join cocoa@apple-dev.groups.io to automatically receive all group messages.