NSBrowserCell subclasses
NSBrowserCell subclasses
- Subject: NSBrowserCell subclasses
- From: Richard Schreyer <email@hidden>
- Date: Sat, 5 May 2001 18:20:30 -0700
Today I created a subclass of NSBrowserCell which, in
-drawInteriorWithFrame, cuts roughly 60 pixels off of the right edge of
the cell frame, in order to place some additional stuff there. I took
the reduced cell frame, and ran the standard implementation of
-drawInteriorWithFrame it so it would draw the normal icon/text on the
left side.
Right now, my problem is that I can't get the highlighting right on the
part I am drawing. I found -highlightColorInView in the NSBrowserCell
header to get the right color, but I don't know which cells I should to
apply this color to.
Calling -isHighlighted only returns Yes on the active column in the
NSBrowser, not the previous columns, which I need to draw the lighter
highlight color in.
I also checked to see if the NSBrowserCells were mixed state, but it
appears not. Does anyone know how to tell if the column should be
highlighted, if it's not the active (right-most) column?
Before I also tried drawing the entire cell myself (and ended up with
the same problem) but I also had problems because the NSBrowserDelegate
-willDisplayCell method was no longer being called when the information
needed to be updated, so my code was only drawing the out of date info.
It seems that the -willDisplayCell method is called by
-drawInteriorWithFrame, and I don't know how to get all the info
necessary for my -drawInteriorWithFrame subclass to call it instead.
If anyone can help with any of these problems, It would help a lot,
Richard Schreyer