Re: Text color in NSOutlineView's selected row
Re: Text color in NSOutlineView's selected row
- Subject: Re: Text color in NSOutlineView's selected row
- From: "email@hidden" <email@hidden>
- Date: Thu, 7 May 2009 14:39:37 +0100
On 7 May 2009, at 14:27, Kevin Gessner wrote:
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.
Try reviewing this thread - it might help
http://www.cocoabuilder.com/archive/message/cocoa/2009/3/12/232149
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
_______________________________________________
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