• 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
Change NSTextFieldCell textColor when text is selected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Change NSTextFieldCell textColor when text is selected


  • Subject: Change NSTextFieldCell textColor when text is selected
  • From: Florian Soenens <email@hidden>
  • Date: Mon, 23 Jul 2007 12:58:51 +0200

Hi list,

i'm struggling with the following:

i subclassed an nsoutlineview and the cells of a specific row are
ImageAndTextCell, like the ones in the DragDropTableView example.
The code in my ImageAndTextCell class  to change the text color when
the cell (the row) is hilighted is the following:

- (NSColor *)textColor
{
   if([self isHighlighted])
   {
       return [NSColor selectedMenuItemTextColor];
   }
   else
   {
       return [NSColor controlTextColor];
   }
}


However, i would like to be able to check if the text is selected so i can change the color to black, because if your background color is green or light pink or whatever, the text is nor readable anymore. iPhoto implements this behavior, so it should be possible...

I can't find a method anywhere like "istextSelected" or so. What
should i do?

Any help is muchos appreciated...

Flor.
_______________________________________________

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


  • Prev by Date: Re: Simple view in NSScrollView
  • Next by Date: Window Level
  • Previous by thread: Re: Simple view in NSScrollView
  • Next by thread: Window Level
  • Index(es):
    • Date
    • Thread