Making a Button the Default Button
If button has the NSRoundedBezelStyle
bezel type, you can mark it as the default button. A default button pulses, and its action message is invoked when the user presses Return. It looks like this:

To mark a button as the default, set its key equivalent to Return with setKeyEquivalent:
, like this:
[myButton setKeyEquivalent:@"\r"]; |
You can also set the button’s key equivalent in Interface Builder, as described in Setting a Button’s Key Equivalent.
The default button has a thick outline drawn around it, outside the button’s border; your interface design should account for that extra space.
Copyright © 2014 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2014-10-16