SOLVED - Was: How? ("Delete" icon as a men u item shortcut…)
SOLVED - Was: How? ("Delete" icon as a men u item shortcut…)
- Subject: SOLVED - Was: How? ("Delete" icon as a men u item shortcut…)
- From: Frédéric BLANC <email@hidden>
- Date: Tue, 7 Jan 2003 00:14:33 +0100
Problem: Find a way to use the "backspace" icon as a NSMenuItem
equivalent.
Ex. : As seen in Apple Mail (for deleting messages.)
Solution (in Obj-C):
unichar backspace = NSBackspaceCharacter;
[myMenuItem setKeyEquivalent:[NSString stringWithCharacters:&backspace
length:1]];
[myMenuItem setKeyEquivalentModifierMask:0]; // To remove the
implicitly-added <Command> modifier key
Solution (in Java):
myMenuItem.setKeyEquivalent(String.valueOf('\b'));
myMenuItem.setKeyEquivalentModifierMask(0);
Thanks to everyone who helped.
- Fred
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.