Ohh this turns out to be more complicated than I thought. Determining if a cell is highlighted is kind of tricky... Especially if you are trying to do this when drawing it or about to draw it. If anyone knows a nice way to determine if the cell isHighlighted while drawing (note there is the line
in - (void) loadCellContents in FSBrowserCell.m, but if I don't set highlighted to NO, then really screwy behavior ensues. Ie lots of things are highlighted when they are not. (ie coming into the loadCellContents the isHighlighted is not in a valid state.) It would be ideal to know when the selection changes, Ie get some notification when the selection changes, and then record the selection and just setHighlighted:YES if something is selected.
This is quite possible for NSTableViews which sends the notification tableViewSelectionDidChange to the delegate. I don't see anything similar which I can latch onto in NSBrowser... See the following discussion on cocoadev