Re: Keyboard shortcuts for views in toolbar items
Re: Keyboard shortcuts for views in toolbar items
- Subject: Re: Keyboard shortcuts for views in toolbar items
- From: Ondra Cada <email@hidden>
- Date: Tue, 15 Oct 2002 17:19:55 +0200
On Tuesday, October 15, 2002, at 04:56 , j o a r wrote:
NSToolbarItem *item;
NSButton *button;
[button setAction: @selector(buttonAction:)];
[button setTarget: self];
[button setKeyEquivalent: @"j"];
[button setKeyEquivalentModifierMask: NSCommandKeyMask];
[item setView: button];
...and expected to be able to trigger the button action using the
keyboard shortcut. It doesn't seem to work.
If someone could tell me how to do this, or if it is impossible in the
current implementation of NSToolbar, I would be grateful.
Not sure whether it is the answer you wanna hear, but the proper way to do
that is to place the actions and their key equivalents into main menu, so
that they are accessible & work properly regardless the appropriate
buttons are in the toolbar or not.
Generally it is a *very bad* practice to have services which are not
accessible through the main menu. The key equivalent stuff just accents
that.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.