I have a dialog with 1 or more buttons and want to be able to programmatically set the rightmost one be the default one, so that when the user presses the Enter or Return key it
My setting has been a custom sheet where I wanted the default button to appear like within an NSAlert. The following configuration gives me the blue default appearance. Works in 10.12.3 Sierra.
button.bezelstyle = NSBezelStyleRounded; // Push in Interface Builder
button.keyEquivalent = @"\r";
button.highlighted = YES; // this is the most important part.