• 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: Highlight color of a NSTableView row
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Highlight color of a NSTableView row


  • Subject: Re: Highlight color of a NSTableView row
  • From: Eric Gorr <email@hidden>
  • Date: Thu, 10 Apr 2008 20:25:07 -0400


On Apr 10, 2008, at 8:00 PM, Eric Gorr wrote:


On Apr 10, 2008, at 6:00 AM, Cathy Shive wrote:

If you're targeting Leopard, there is an NSTableView method you can override for this (a public one!)

-(void)highlightSelectionInClipRect:(NSRect)theClipRect

You have to actually draw the highlights, it's not simply a matter of setting the color. If you look at the post Ben linked to, there is sample code you can download that will show you what to do.


Playing with this a bit more, it appears that I need to also do:

- (id)_highlightColorForCell:(NSCell *)cell
{
// we need to override this to return nil
// or we'll see the default selection rectangle when the app is running
// in any OS before leopard

// you can also return a color if you simply want to change the table's default selection color
return nil;
}


Or it will ignore my highlight drawing entirely. It appears this is an undocumented API or, at least, I cannot locate it in the documentation.

Once I tossed this in, there weren't white spaces between the columns.

So, is there a way to do this without using undocumented APIs?

_______________________________________________

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: Highlight color of a NSTableView row
      • From: Corbin Dunn <email@hidden>
References: 
 >Highlight color of a NSTableView row (From: Eric Gorr <email@hidden>)
 >Re: Highlight color of a NSTableView row (From: Ben Lachman <email@hidden>)
 >Re: Highlight color of a NSTableView row (From: Cathy Shive <email@hidden>)
 >Re: Highlight color of a NSTableView row (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: ObjC static member variable
  • Next by Date: Re: Highlight color of a NSTableView row
  • Previous by thread: Re: Highlight color of a NSTableView row
  • Next by thread: Re: Highlight color of a NSTableView row
  • Index(es):
    • Date
    • Thread