Re: Icons in NSOutlineView
Re: Icons in NSOutlineView
- Subject: Re: Icons in NSOutlineView
- From: Eric Peyton <email@hidden>
- Date: Thu, 31 May 2001 09:59:05 -0500
Set your NSOutlineView to use NSBrowserCells instead of standard
NSCells.
Code like this should work for you ...
[column setDataCell:[[NSBrowserCell alloc] init]];
(where column is the column in the outline view you want to have
the icon ...
Then later in your outline view delegate when you "fill in" the cell
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayCell:(id)cell forTableColumn:(NSTableColumn
*)tableColumn item:(id)item
{
[cell setImage:someImage];
}
No subclassing required.
Eric
On Wednesday, May 30, 2001, at 06:04 PM, Jared White wrote:
Hi everyone,
I'm in the early stages of learning Cocoa, and I was wondering if
there were
a way to insert icons before the text of items in an NSOutlineView
control
without doing some kind of fancy subclassing/custom view thing.
I'm working
on a note/memo pad type of program with a category/note outline
view, and it
would be nice if note categories could have a folder icon, notes
could have
a sticky note icon, etc.
Thanks in advance for your help.
Regards,
Jared
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev