[Newbie] NSOutlineView and icons
[Newbie] NSOutlineView and icons
- Subject: [Newbie] NSOutlineView and icons
- From: Jérome Foucher <email@hidden>
- Date: Thu, 13 Feb 2003 11:46:18 +0100
Hi all,
I'm trying to learn Cocoa, and started looking at the examples that
come with the Dev Tools.
Right now I'm trying to modify the OutlineView sample (sample outline
view that displays a folder's hierarchy) so that it displays the icons
of the files/folders too.
NSCell seems to support NSImages, so I tried to add a delegate method
in my DataSource:
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayCell:(NSCell *)cell forTableColumn:(NSTableColumn
*)tableColumn item:(id)item {
if ([[tableColumn identifier] isEqualToString: COLUMNID_NAME]) {
// Set the image here since the value returned from
outlineView:objectValueForTableColumn:... didn't specify the image
part...
[cell setImage: [item image]];
[cell setStringValue: [item relativePath]];
}
}
I've added the -(NSImage*)image thing to FileSystemItem so that it asks
the NSWorkspace for the file's icon.
But no luck. No icons are being displayed.
Am I missing something ?
Thanks
Jerome
_______________________________________________
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.