Re: Make About window respond to ⌘W in UI-less application
Re: Make About window respond to ⌘W in UI-less application
- Subject: Re: Make About window respond to ⌘W in UI-less application
- From: Michael Dippery <email@hidden>
- Date: Tue, 27 Apr 2010 15:06:09 -0400
> Sorry, didn't read your email properly. If you've already created a menu in your MainMenu nib and it's not working, perhaps you haven't actually made the connection in the nib. If that's the case, then you just need to Control-drag from your Close menu item to the First Responder in the nib and connect it to the close: action. If you've already done that and it still doesn't work then I'm lost.
I was afraid I'd forgotten the step of hooking up the Close menu item I created to First Responder's close: action, so I went ahead and tried again. Here is exactly what I did:
1. Created a new menu in MainMenu nib with a single item, Close, with the key mnemonic ⌘W.
2. Hooked up the menu item to the close: action in First Responder.
When I loaded up the app's About window and hit ⌘W, I got the usual system beep I described before.
Of course, the issue is that I _still_ may not have something in the responder chain set up to properly the keyboard event, but I'm not really sure what to do even if I _could_ respond to the keyboard event somewhere else (e.g., my delegate); I don't have a reference to the About window -- I assume it's created programmatically in -[NSApp orderFrontStandardAboutPanel:], and I can't find a method for grabbing a reference -- so I'm not sure how I could close it from some other part of the code anyway.
----
Michael Dippery
email@hidden | www.monkey-robot.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden