How to hide focus ring for NSTextFieldCell?

I am trying to get this blue frame (which is around NSTextFieldCell when you can edit the value). Is there any way to handle this anyway? At the same time, the user still has to change the text by simply double-clicking.

For the table itself, I got rid of it by setting the Focus ring for this parameter to None. But I can not find it for any text field, unfortunately ...

+4
source share
1 answer

Remember to check the superclasses when viewing documents. In this case, since NSTextFieldCell inherits from NSCell , you want to use -[NSCell setFocusRingType:] .

The easiest way to get a cell before it is focused is probably the NSTableViewDelegate tableView:shouldEditTableColumn:row: method tableView:shouldEditTableColumn:row:

 - (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { NSTextFieldCell * cell = [tableColumn dataCellForRow:row]; [cell setFocusRingType:NSFocusRingTypeNone]; return YES; } 
+15
source

All Articles