Re: [NSTableview] can't make selected text stay black
Re: [NSTableview] can't make selected text stay black
- Subject: Re: [NSTableview] can't make selected text stay black
- From: Corbin Dunn <email@hidden>
- Date: Fri, 12 Mar 2010 15:27:31 -0800
Please don't override the private method. Your app is likely to break if you do so.
>
> Your solution was perfect. (It didn't work at first, but that's because I had somehow left HighlightStyle as source list in IB while I was trying everything. Per your note, the first thing I checked & then perfection.)
>
> As you mention, overriding -highlightSelctionInClipRect is unneeded. I also can get away with leaving out the [cell setTextColor:[NSColor blackColor]] as long as I set the background style -- but I'm testing on 10.6 and who knows about 10.5 and it can't hurt.
>
> Thanks for the pointer. A five-minute task turned out to be anything but...
>
> Kent
>
> On Tue, Mar 9, 2010 at 8:37 AM, Keith Blount <email@hidden> wrote:
> Hi,
>
> Actually the only way I know of doing this pre-10.6 is to override NSTableView's private _highlightColorForCell: method to return nil. Even if you override -highlightSelectionInClipRect: to do nothing, the cell drawing will still use the highlight colour returned from this private method.
If overriding this fixed the problem, then the issue isn't the table drawing the highlight, but the cell. override this in NSCell and return nil:
- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
It would be apparent to see that this is the problem by looking at it and seeing blue around just the cells, and not between columns/rows (ie: intercellSpacing).
-corbin
_______________________________________________
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