I have view-based NSTableView
with custom NSTextField
subclass instances to draw the row labels.
Depending on if a row is selected (highlighted) I want to change the background color of my custom text field.
How do I know in drawRect:(NSRect)dirtyRect
of my text field if the parent table row is selected?
The text field doesn't even know that it is part of a table view (and shouldn't have to).
If I put a plain NSTextField
into a table view it automatically changes its font color based on the row selection status so it must be somehow possible for a text field to know if it is selected/highlighted or now.