• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Newbie] NSOutlineView and icons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >[Newbie] NSOutlineView and icons (From: Jérome Foucher <email@hidden>)

  • Prev by Date: Re: [NSString stringWithContentsOfURL:] question
  • Next by Date: text view drawing upside down... HELP!
  • Previous by thread: [Newbie] NSOutlineView and icons
  • Next by thread: Creating Menu Items Programmatically.
  • Index(es):
    • Date
    • Thread