Alt. Background color and variable row height in NSTableView and NSOutlineView
Alt. Background color and variable row height in NSTableView and NSOutlineView
- Subject: Alt. Background color and variable row height in NSTableView and NSOutlineView
- From: Alykhan Jetha <email@hidden>
- Date: Tue, 9 Oct 2001 13:21:51 -0400
Gang,
I have 2 questions. I feel they should be obvious but I'm not
finding the appropriate method(s). I could be missing something.
1) I want to set alternating background row colors in a
tableview and an outlineview. The only thing I've found is the
ability to set the cell background color (and set the background
color on the whole table), so I'd have to set the background
color on each cell. It' seems like overkill to me. Am I missing
some obvious method to set the color or return the background
color for a given row?
2) Both tableview and outlineview have a default row height. Is
there an easy way to change the row height on a row by row
basis. I found the following methods.
- (NSRect)rectOfRow:(int)row;
- (NSRect)frameOfCellAtColumn:(int)column row:(int)row;
Should I subclass outlineview and tableview, call super
rectOfRow, then modify the height to reflect my needs (i.e. a
multi-line wrapped textfield cell)?
Once again, I'm feeling like I'm missing something obvious.
TIA
./aj