• 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: - outlineView:willDisplayCell:forTableColumn:item: and selected item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item


  • Subject: Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item
  • From: Seth Willits <email@hidden>
  • Date: Tue, 26 Feb 2008 22:21:38 -0800

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


  • Follow-Ups:
    • Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item
      • From: Corbin Dunn <email@hidden>
    • Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item
      • From: John Stiles <email@hidden>
References: 
 >- outlineView:willDisplayCell:forTableColumn:item: and selected item (From: John Stiles <email@hidden>)
 >Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item (From: "Ken Ferry" <email@hidden>)
 >Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item (From: "Ken Ferry" <email@hidden>)
 >Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item (From: John Stiles <email@hidden>)
 >Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item (From: John Stiles <email@hidden>)
 >Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item (From: "Ken Ferry" <email@hidden>)
 >Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item (From: John Stiles <email@hidden>)
 >Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item (From: "Ken Ferry" <email@hidden>)
 >Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Animated button
  • Next by Date: Re: Observing with GC
  • Previous by thread: Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item
  • Next by thread: Re: - outlineView:willDisplayCell:forTableColumn:item: and selected item
  • Index(es):
    • Date
    • Thread