I'm building a Cocoa application that runs as an item in the status bar, and 
I'm using LSUIElement to prevent the app's icon from appearing in the Dock. 
This application has an About window and an item to activate that window, using 
the standard Cocoa mechanism for doing so (that is, -[NSApplication 
orderFrontStandardAboutPanel:]).

It works great except for one thing: unlike most About windows, it shows up 
_underneath_ all other windows, rather than on top. I worked around this by 
creating an IBAction in my app's controller that first brings the app to the 
front, and then shows the window, like so:

- (IBAction)orderFrontStandardAboutPanel:(id)sender
{
    [NSApp activateIgnoringOtherApps:YES];
    [NSApp orderFrontStandardAboutPanel:sender];
}

This causes the About window to appear on top of other windows, but the window 
does not respond to the ⌘W keyboard event; instead, I just get the system alert 
beep, indicating that nothing is in place to handle the event. Since I don't 
have a reference to the About window (as it's created by NSApplication) I can't 
figure out how to hook up a mechanism for handling the keyboard event, and it 
doesn't seem to get passed to my app controller, even though it's a delegate of 
NSApp (if I understand the responder chain correctly, NSApp will pass some 
unhandled events on to its delegate).

Is there a way to get the About window to respond to ⌘W?


Thanks,



----
Michael Dippery
mdipp...@gmail.com | www.monkey-robot.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to