• 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] can't make selected text stay black
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSTableview] can't make selected text stay black


  • Subject: Re: [NSTableview] can't make selected text stay black
  • From: Noah Desch <email@hidden>
  • Date: Fri, 5 Mar 2010 17:52:02 -0500

Cells highlight using white text based on the background style as far as I can tell. Try:

[cell setBackgroundStyle:NSBackgroundStyleLight];

Instead of setting the text color.

-Noah



On Mar 5, 2010, at 5:25 PM, Kent Hauser wrote:

> Hi,
>
> I'm trying to make a NSTableView selected row not look selected. I
> subclassed NSTableView & added the following class & delegate methods:
>
> // remove selection indication
> - (void)highlightSelectionInClipRect:(NSRect)clipRect
> {
>    NSLog (@"%s", __FUNCTION__);
> }
>
> // change selected cell text color (delegate method)
> - (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell
> forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex
> {
>    NSLog (@"%s", __FUNCTION__);
>    if ([cell respondsToSelector:@selector(setTextColor:)])
>        [(id)cell setTextColor:[NSColor blackColor]];
> }
>
> While the "hightlightSelection" method does it's job, my delegate method
> doesn't paint the text black. (However, if I use redColor, I get red text).
>
> What am I missing?
>
> Thanks. Kent

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [NSTableview] can't make selected text stay black
      • From: Kent Hauser <email@hidden>
References: 
 >[NSTableview] can't make selected text stay black (From: Kent Hauser <email@hidden>)

  • Prev by Date: Re: predicate for a Core Data fetch request rejected by SQL
  • Next by Date: NSTextField controlTextDidEndEditing
  • Previous by thread: [NSTableview] can't make selected text stay black
  • Next by thread: Re: [NSTableview] can't make selected text stay black
  • Index(es):
    • Date
    • Thread