• 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
Gradient NSOutlineView row - Text color of it's NSTextFieldCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Gradient NSOutlineView row - Text color of it's NSTextFieldCell


  • Subject: Gradient NSOutlineView row - Text color of it's NSTextFieldCell
  • From: Florian Soenens <email@hidden>
  • Date: Sat, 28 Jul 2007 11:44:12 +0200

Hi list,

i'm struggling with the following:

i subclassed an nsoutlineview to implement the gradient look when rows are selected.
The cells of a specific row are of class 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];
   }
}

In my NSOutlineView i also overwrite the private method _highlightColorForCell to get rid of the color this method is returning.
The problem is that this method also takes care of changing the textcolor to black again when the text is selected.
In my case the textcolor stays white, no mather what. This causes the text to be unreadable when it is selected.


I can't find a method anywhere to check whether the text is selected like "istextSelected" or so. What should i do?

Any help is much 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


  • Follow-Ups:
    • Re: Gradient NSOutlineView row - Text color of it's NSTextFieldCell
      • From: Oliver Quas <email@hidden>
    • Re: Gradient NSOutlineView row - Text color of it's NSTextFieldCell
      • From: "Alan Smith" <email@hidden>
  • Prev by Date: Re: Sending message to Objective-C object from C file
  • Next by Date: Re: Autorelease/Retain/Release
  • Previous by thread: Re: Sending message to Objective-C object from C file
  • Next by thread: Re: Gradient NSOutlineView row - Text color of it's NSTextFieldCell
  • Index(es):
    • Date
    • Thread