In CSS, you can change the effect of focusing on something using:
.myelement:focus { ... }
While in Cocoa, the text fields always have an ugly blue glow. How do I change the effect of focusing on an NSTextField (or not have it do anything at all)?
The Cocoa equivalent of the command above would be:
[[textField window] makeFirstResponder:textField];
As to changing the appearance, are you asking how to change it for all controls in all applications ("globally") or just for a text field in your own app? There's no API for a global change, so system hacks are your only avenue. Good luck.
For controls you own (those that belong to your own application), you can set the focus ring type in Interface Builder or by code at runtime like this:
[textField setFocusRingType:NSFocusRingTypeNone];
// (or NSFocusRingTypeDefault or NSFocusRingTypeExterior)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With