Re: NSCell for customize a NSTableView
Re: NSCell for customize a NSTableView
- Subject: Re: NSCell for customize a NSTableView
- From: Ryan Stevens <email@hidden>
- Date: Mon, 6 May 2002 19:32:09 -0700
On Monday, May 6, 2002, at 12:32 PM, email@hidden wrote:
Hello, I want to draw different images in a NSTableView column. I can
use NSTableView to get the NSTableColumn and the
set the cell with setDataCell. But with this I get the same cell type
for the column. How can I assign, for example,
different images for a column in each row?
Thanks.
In your tableview delegate put something like...
- (void)tableView:(NSTableView *)view willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)col row:(int)row
{
if ( [...] ) [cell setImage: anImage ];
if (![cell image]) [cell setImage: defaultImage];
}
Otherwise, you can subclass NSTableColumn, make your tableview use that
and return specific cells (with specific images) from its
-dataCellForRow: method.
HTH!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.