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

Re: NSTableView


  • Subject: Re: NSTableView
  • From: Ondra Cada <email@hidden>
  • Date: Fri, 31 May 2002 02:53:20 +0200

On Thursday, May 30, 2002, at 11:44 , mmalcolm crawford wrote:

... and this, as Ondra appears to have mentioned back in April, is not the best way to achieve the desired result.

Thanks ;)

You don't have to create your own attributed string, you can leave it up to the cell, as per my example May 26:

- (void)tableView:(NSTableView *)tableView
willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn row:(int)row
{
if (<test>) {
[cell setTextColor:[NSColor redColor]];
}
// strictly should also have:
else {
[cell setTextColor:[NSColor blackColor]];
}
}

Perhaps it's worth to point out that the else branch is *important* indeed -- since one cell is re-used for all rows, without it the results would be erratic and improper.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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: 
 >Re: NSTableView (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: NSURL question (not so easy (i think))
  • Next by Date: Re: NSURL question (not so easy (i think))
  • Previous by thread: Re: NSTableView
  • Next by thread: Re: NSTableView
  • Index(es):
    • Date
    • Thread