Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stop my NSbutton from being selected when the app starts by default?

I created a button, and a have a little problem: When the my app launches, the button is selected. How do I disable this selection?

Example:

A window with two buttons. The first (left) has a blue glow around it, and the second (right) does not.

like image 719
Alexander Avatar asked Apr 26 '11 07:04

Alexander


1 Answers

Caveat: This answer is incomplete: It just hides the focus ring (without preventing the selection). There's little benefit in this solution.

Set your button's focus ring type to none:

[myButton setFocusRingType:NSFocusRingTypeNone];

You can also set this option in the XIB.

like image 172
Nikolai Ruhe Avatar answered Dec 12 '22 15:12

Nikolai Ruhe