• 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
Text color in NSOutlineView's selected row
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Text color in NSOutlineView's selected row


  • Subject: Text color in NSOutlineView's selected row
  • From: Kevin Gessner <email@hidden>
  • Date: Thu, 7 May 2009 15:27:59 +0200

I'm trying to remove the highlighted appearance from the selected row of an NSOutlineView (and draw the row like an unselected row). I'm overriding highlightSelectionInClipRect: as a no-op, to remove the whole row's selection background. I'm also overriding preparedCellAtColumn:row: to call super, then call setHighlighted:NO on the cell before returning it. This does much of what I want: the blue background is gone.

However, if I edit a cell, then click away to end editing, the last- edited cell's text is drawn in white. Since my outline view has a white background, the text disappears. I'd like the text to draw in black at all times. What I've tried:

1. When editing ends, unselect the row. This won't work because I need the selection as an internal pointer of the last cell edited.
2. In preparedCellAtColumn:row:, also calling setTextColor:[NSColor blackColor] on the cell. This doesn't fix the problem - the text still draws white.
3. Using a custom NSTextFieldCell subclass (via IB), which overrides textColor to always return [NSColor blackColor]. This also doesn't work - the text draws white.


Is there any way to get the appearance I'd like? I haven't seen any specific methods to control the appearance of the selected row, and I'm out of obvious places to set the text color.

Thanks in advance.

-- Kevin

Kevin Gessner
http://kevingessner.com
email@hidden





_______________________________________________

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: Text color in NSOutlineView's selected row
      • From: "email@hidden" <email@hidden>
  • Prev by Date: Missing EOF (Was Re: Core Data Migration and the Inexperienced Younger Self)
  • Next by Date: Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!
  • Previous by thread: Re: Dashboard-style window flip.
  • Next by thread: Re: Text color in NSOutlineView's selected row
  • Index(es):
    • Date
    • Thread