NSTableView: blue line on right-click rows

I am wondering how I can get rid of the blue outlines that Cocoa draws around rows in an NSTableView / NSOutlineView when right-clicking on them.

NSTableView Outline http://tobidobi.com/nstableview_outline.png

It seems that this is not a classic "highlight", but a "focus ring", if I'm not mistaken - so what is it, really?

I am currently setting up custom NSCells myself, but I cannot figure out how to either * draw this plan myself, or
* get rid of him, or
* at least change color

Any hints are greatly appreciated! Thanks!

+6
cocoa nstableview
source share
2 answers

Unfortunately, I don’t know of any documentary way to do this, except for writing your own table view replacement.

Override Method:

- (void)drawContextMenuHighlightForRow:(NSInteger)row; 

Please write an improvement request with Apple, so you don’t have to rely on undocumented methods to do what you want in the future. It seems that the other two table highlighting methods were made custom in 10.6, but this was not. I always thought this was a bit clumsy look, but you must specify which line the menu refers to (not necessarily the same as the highlighted line).

+12
source share

My NSTableView * mainTableView is not subclassed, so I got rid of it just before the context menu opens:

 - (void)menuWillOpen:(NSMenu *)menu{ NSInteger rightClicked = [mainTableView clickedRow]; [mainTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:rightClicked] byExtendingSelection:NO]; [mainTableView deselectRow: rightClicked]; [mainTableView reloadData]; { 
+1
source share

All Articles