Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item
Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item
- Subject: Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item
- From: John Stiles <email@hidden>
- Date: Wed, 27 Feb 2008 08:59:42 -0800
Right, agreed. Ken's idea was that I would implement my own
-drawInteriorWithFrame:inView:, which is what I was saying I didn't want
to do.
Seth Willits wrote:
On Feb 26, 2008, at 3:13 PM, John Stiles wrote:
Trying to simulate the drawing behavior of NSCell seems error-prone
to me. Since I don't have access to the original code, it would be
hard to match its behavior. I'd much rather inherit as much as I can
and only customize around the edges.
You're not replicating a whole lot here, however. If you're already
setting the multi-colored text color in willDisplayCell: for every
cell, then the minimal amount of work you need should be to call
setTextColor before calling the super class's implementation of
drawInteriorWithFrame if the cell is highlighted and active.
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView
*)controlView;
{
BOOL isWindowActive = [[[self controlView] window] isKeyWindow] &&
[[NSApplication sharedApplication] isActive];
BOOL isControlActive = isWindowActive && ([[[self controlView]
window] firstResponder] == [self controlView]);
if (isControlActive && [self isHighlighted]) {
[self setTextColor:[NSColor whiteColor]];
}
[super drawInteriorWithFrame:cellFrame inView:controlView];
}
You can of course get more involved, but this as a minimum should
work. The only thing happening here is what you want: to override the
higlight color.
--
Seth Willits
_______________________________________________
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