Date
1 - 8 of 8
find standard about panel
James Walker
On Mar 13, 2019, at 8:01 PM, Jon Gotow <gotow@...> wrote: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. |
|
James Walker
On Mar 13, 2019, at 8:07 PM, Graham Cox <graham@...> wrote:True, but this is a little freeware side project, and I didn’t feel like polishing that much. |
|
Jack Brindle
The About window has no name - the title is blank.
toggle quoted message
Show quoted text
it would seem that a more interesting way to do the would be to use the [NSWindow windowNumberWithOptions:] method, which does return an array of windows for the app (options = 0) that is ordered in a front to back order. Since you are getting an array of windows you should be able to apply any test you wish too them. There are other methods, such as [NSApplication windows] that will also give you an array of all application windows, shown or not, but they are not ordered. Jack On Mar 13, 2019, at 8:01 PM, Jon Gotow <gotow@...> wrote: |
|
Graham Cox
On 14 Mar 2019, at 1:32 pm, Graham Cox <graham.cox@...> wrote:
Ah, fair point! How hard is it then to make your own About box? To bring it up instead of the prebuilt one is a very small change to the ‘About’ menu item, to target a different method. Making your own About box is part of polishing your app anyway, in most cases. —G |
|
Jon Gotow
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?
toggle quoted message
Show quoted text
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. - Jon On 14 Mar 2019, at 8:41 am, James Walker <list2@...> wrote: |
|
James Walker
On Mar 13, 2019, at 4:35 PM, Graham Cox <graham@...> wrote:The standard About panel doesn’t exist in a nib, it’s synthesized by AppKit.
|
|
Graham Cox
In Interface Builder, just check the “Hides on Deactivate” checkbox for the panel. That should do it… have you tried it?
toggle quoted message
Show quoted text
—G
|
|
James Walker
How can I find the window produced by -[NSApplication orderFrontStandardAboutPanel:]? (I’d like to hide the window when my app deactivates.) I know it’s somewhere in the array -[NSApplication windows], but I don’t know how to identify which one. |
|