Re: Icons in NSOutlineView
Re: Icons in NSOutlineView
- Subject: Re: Icons in NSOutlineView
- From: Enrique Zamudio <email@hidden>
- Date: Thu, 31 May 2001 18:28:22 -0500
- Organization: Nasoft
When you load the nib, setup the column of the outline view where you
want to show the icons. You get the column and set its dataCell to be a
NSImageCell instead of the standard NSTextFieldCell it comes with. Then,
the outline views' datasource can return an image for that column when
needed.
I don't have the headers at hand, but off the top of my head it should
be something like this:
NSTableColumn *column;
NSImageCell *imageCell = [[NSImageCell alloc] init];
//get the column somehow
column = [outline columnWithIdentifier:@"icon"];
//set its data cell
[column setDataCell:imageCell];
//release the cell; it's being retained by the column now.
[imageCell release];
eZL