• 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: Suppressing highlight drawing in an NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suppressing highlight drawing in an NSTableView


  • Subject: Re: Suppressing highlight drawing in an NSTableView
  • From: Greg Hurrell <email@hidden>
  • Date: Thu, 11 May 2006 15:53:28 +0200

El 11/05/2006, a las 15:18, Nick Zitzmann escribió:

AFAIK, the only way to do this is to subclass NSTableView and override a private method, -_highlightColorForCell:. If this method returns nil, then the highlight won't draw.

Thanks a million, Nick.

For a while there I thought I was onto something by overriding highlightColorWithFrame:inView: in my custom cells. Returning a transparent color doesn't work (seems that alpha is ignored) but I thought returning nil would. At least in initial testing it seemed to work, but then it reverted to the old behaviour so perhaps I was imagining it.

I tried the private method you suggest and it *almost* worked. Instead of bright blue selection highlight I get almost-invisible light gray highlighting! But armed with the knowledge that the method is called "_highlightColorForCell:" I did a search of the list archives and saw that someone recommended returning [self backgroundColor].

That *almost* worked as well, although the behaviour was slightly different. I believe the problem is that I have my table view set to use an alternating background colors for the rows. I found that by returning nil from _highlightColorForCell: *and* overriding highlightSelectionInClipRect: to be a no-op then I got the behaviour I need.

Many thanks, Nick!

Cheers,
Greg


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Suppressing highlight drawing in an NSTableView (From: Greg Hurrell <email@hidden>)
 >Re: Suppressing highlight drawing in an NSTableView (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Refactoring tools available for Cocoa / ObjC?
  • Next by Date: Re: Subviews becoming blurry or "chopped up"
  • Previous by thread: Re: Suppressing highlight drawing in an NSTableView
  • Next by thread: NSTreeController Grouping Nodes - Grouping At All
  • Index(es):
    • Date
    • Thread