How to set custom NSMatrix in an NSBrowser

195 views Asked by At

I am trying to customise background colours for an NSBrowser. To do this I am trying to subclass NSMatrix, set me new class as the matrix class for columns using setMatrixClass:, and then customise the matrix somehow, maybe using drawRect:.

I can verify using breakpoints that by NSBrowser has the custom class set as its matrixClass. However, no breakpoints in the matrix class are ever hit (I have overridden all 4 constructors, drawRect, drawLayer and awakeFromNib as a test). Nothing ever happens, its like my NSBrowser is ignoring the matrixClass.

I tried setting the matrix class for the NSBrowser to NSApplication just to see if anything would happen. Once again, no results. Surely this should have caused some kind of crash? Does setMatrixClass: even work?

0

There are 0 answers