• 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: [NSTableview] can't make selected text stay black
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: [NSTableview] can't make selected text stay black (From: Keith Blount <email@hidden>)
 >Re: [NSTableview] can't make selected text stay black (From: Kent Hauser <email@hidden>)

  • Prev by Date: Re: NSTableView _dataSourceValueForColumn:row: failure
  • Next by Date: Re: [NSTableview] can't make selected text stay black
  • Previous by thread: Re: [NSTableview] can't make selected text stay black
  • Next by thread: Re: [NSTableview] can't make selected text stay black
  • Index(es):
    • Date
    • Thread