• 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: NSCell for customize a NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCell for customize a NSTableView


  • Subject: Re: NSCell for customize a NSTableView
  • From: Ryan Stevens <email@hidden>
  • Date: Mon, 6 May 2002 19:32:09 -0700

On Monday, May 6, 2002, at 12:32 PM, email@hidden wrote:

Hello, I want to draw different images in a NSTableView column. I can use NSTableView to get the NSTableColumn and the
set the cell with setDataCell. But with this I get the same cell type for the column. How can I assign, for example,
different images for a column in each row?

Thanks.


In your tableview delegate put something like...

- (void)tableView:(NSTableView *)view willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)col row:(int)row
{
if ( [...] ) [cell setImage: anImage ];

if (![cell image]) [cell setImage: defaultImage];
}


Otherwise, you can subclass NSTableColumn, make your tableview use that and return specific cells (with specific images) from its -dataCellForRow: method.

HTH!
_______________________________________________
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: 
 >NSCell for customize a NSTableView (From: email@hidden)

  • Prev by Date: NSTextView (Java) sizeToFit not working
  • Next by Date: Where to put "Check for Updates" menu item
  • Previous by thread: NSCell for customize a NSTableView
  • Next by thread: Fwd: NSCell for customize a NSTableView
  • Index(es):
    • Date
    • Thread