Re: [Newbie] NSOutlineView and icons
Re: [Newbie] NSOutlineView and icons
- Subject: Re: [Newbie] NSOutlineView and icons
- From: Robert Cerny <email@hidden>
- Date: Thu, 13 Feb 2003 17:15:12 +0100
Hi,
I believe you need to set cell type. Check DragNDropOutlineView sample
on your disk...
Robert
On Thursday, Feb 13, 2003, at 11:46 Europe/Prague, Jirome Foucher wrote:
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.
_______________________________________________
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.