Icon in NSOutlineView
Icon in NSOutlineView
- Subject: Icon in NSOutlineView
- From: Justin Lundy <email@hidden>
- Date: Mon, 30 Dec 2002 10:57:21 -0800
I'm using an NSOutlineView as a file system browser and want to get the
icons for each file to show up next to the item. I looked through the
archives and found that I needed to add two parts to get this to work,
first change the NSCell to an NSBrowserCell, and then add the function
that gives the cell its image.
In the data source I added:
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayCell:(id)cell forTableColumn:(NSTableColumn
*)tableColumn item:(id)item
{
[cell setImage: [(NSImage *)iconForFile:(NSString *)fullPath]];
}
But Where do I add to following? Should it be in the data source or
the app controller?
[fileColumn setDataCell:[[NSBrowserCell alloc] init]];
Thanks in advance,
Justin
_______________________________________________
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.