Button shortcut key combination


#1

I can’t get a simple pushbutton’s shortcut key equivalent (shift-command-N in this case) to show with the button name. Does this only work with menu items?


#2

Hm, I’m not sure I understand what it is that you’re looking for. Do you have a picture that you could link us to, that shows the sort of behavior you want?


#3

Look at the Finder’s file menu, where it says “New folder” followed by symbols for the shift key, the command key, and the letter N. I want the same effect on a button, with “New item” instead of “New folder”.


#4

Ah-ha. Unfortunately, the Cocoa frameworks don’t give us any sort of free functionality for putting key equivalents on buttons like it does for menu items. You’ll need to roll your own solution. :-/


#5

Thanks; that agrees with what I had observed, but hoped was not true. So now I have created an image and want to put that image on the button next to the button title. The image is there where I want it in Interface Builder but not in the built application. Why not? Am I going to have to subclass NSButton?