Re: Suppressing highlight drawing in an NSTableView
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