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: Ron Fleckner <email@hidden>
- Date: Wed, 28 Apr 2010 00:16:27 +1000
On 27/04/2010, at 11:49 PM, Michael Dippery wrote:
Don't why it's not working for you. My LSUIElement app similarly
has no menu bar or dock icon, but it's various ancillory windows
(About plain vanilla version, Preferences) respond to key board
short cuts which are set in the main menu nib. I have done no
special hacks to achieve this, it Just Works™.
Does your app have a MainMenu nib file?
Perhaps this is why it isn't working: I do have a MainMenu nib, but
I have long since deleted the MainMenu object in MainMenu.nib. I
tried to add a new menu with a Close option that responds to the
appropriate keyboard shortcut, but I'm not sure how make that the
"main" menu. Maybe that's the issue?
I think all you would have to do, if you have a nib named MainMenu.nib
in your project, is to create a menu in it and give it whatever titles
with shortcuts you want. That menu will never be seen (because your
app is LSUIElement == 1) but the short cuts will still work -- when
your app has focus or is frontmost.
Ron
_______________________________________________
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