• 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: Icons in NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Icons in NSOutlineView
      • From: Brian Hill <email@hidden>
    • RE: Icons in NSOutlineView
      • From: "Jared White" <email@hidden>
References: 
 >Icons in NSOutlineView (From: "Jared White" <email@hidden>)

  • Prev by Date: NSDateFormatter and \n
  • Next by Date: Placing a PDF file form within a cocoa app
  • Previous by thread: Icons in NSOutlineView
  • Next by thread: RE: Icons in NSOutlineView
  • Index(es):
    • Date
    • Thread