Specifically, I'd like to make an NSTokenField
ignore mouse events because I'm using it in a NSTableCellView
just to display data in a tokenized way without allowing any editing.
Setting the token field's enabled = NO
works, except that it greys out the tokens and makes it hard to read the text.
Setting the token field's editable = NO
is pretty close to what I want—it prevents editing while preserving the token field's look—except that when I mouse over the tokens, they light up. If I could just prevent that, I'd be in business.
I suspect I need to subclass something and override some NSResponder
methods, but not quite sure what to do. I tried subclassing NSTokenField
and overriding mouseEntered:
and mouseMoved:
to do nothing, but that didn't work either.