Re: row bg color in NSOutlineView
Re: row bg color in NSOutlineView
- Subject: Re: row bg color in NSOutlineView
- From: "John C. Randolph" <email@hidden>
- Date: Fri, 21 Dec 2001 04:22:20 -0800
On Friday, December 21, 2001, at 04:03 AM, Raphael Sebbe wrote:
Hello all,
What is the best way of setting the background color in an
outline view, per row, based on item kind ? I tried some custom
data cells (NSTextFieldCell) but its background color is
ignored (or changed to white just before drawing ?). Attributed
string is not what I want because it won't cover the entire row
(just the text).
Also, if that can help, I use a custom NSTableColumn subclass.
To save storage, NSTableView reuses cells to draw multiple items.
The docs say:
- (void)tableView:(NSTableView *)aTableView
willDisplayCell:(id)aCell forTableColumn:(NSTableColumn
*)aTableColumn row:(int)rowIndex
Informs the delegate that aTableView will display the cell at
rowIndex in aTableColumn using aCell. The delegate can modify
the display attributes of aCell to alter the appearance of the
cell. Because aCell is reused for every row in aTableColumn, the
delegate must set the display attributes both when drawing
special cells and when drawing normal cells.
-jcr
[Objc retain];