Re: Arrow keyEquivalent in InterfaceBuilder
Re: Arrow keyEquivalent in InterfaceBuilder
- Subject: Re: Arrow keyEquivalent in InterfaceBuilder
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 31 Dec 2004 17:39:57 -0500
on 2004-12-31 4:15 PM, Lorenzo at email@hidden wrote:
> in InterfaceBuilder, open the menu object, then just double click on the
> "Key-Equivalent" field in the "menu item" line (not in the inspector), then
> when ready hit the arrow key on your keyboard. You will see the arrow symbol
> in the "Key-Equivalent" field. Now, in the Inspector panel, you can even add
> modifier keys like Comman, Option, or Control key.
<Sigh> I wasted so much time doing this in code. I suppose this is
documented somewhere, and I just never noticed it?
Will the nib file work when you run the app under Mac OS X 10.2 Jaguar?
A code way to do this is to put a few lines of code in -awakeFromNib, like
this:
unichar rightwardsArrow = 0x2192;
[[self myMenuItem] setKeyEquivalent:[NSString
stringWithCharacters:&rightwardsArrow length:1]];
[[self myMenuItem] setKeyEquivalentModifierMask:0]; // Command key
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden