Re: Correctly Subclassing NSTableHeaderCell?
Re: Correctly Subclassing NSTableHeaderCell?
- Subject: Re: Correctly Subclassing NSTableHeaderCell?
- From: Steve Nygard <email@hidden>
- Date: Thu, 3 Jan 2008 10:19:51 -0700
On 3-Jan-2008, at 09:33 , Daniel Kennett wrote:
Hey all,
I'm trying to subclass NSTableHeaderCell to get a darker look, a'la
iTunes and iCal. I've got it drawing perfectly well and I'm happy
with the look, but I can't get it to highlight when clicked or is
the sorted column, and I can't get it to show the sort direction
indicator either.
I've searched the docs and online, but can't seem to find anything.
Has anyone done this successfully?
NSTableHeaderCells behave a bit differently than other cells.
Normally -[NSCell highlight:withFrame:inView:] just sets the
isHighlighted flag (and probably marks the view as needing display).
NSTableHeaderCell, on the other hand, performs the drawing
immediately. So -drawWithFrame:inView: is used to draw an unselected
table header cell, and -highlight:withFrame:inView: is used to draw a
selected table header cell.
It uses the cell state for the extra highlight during mouse tracking.
I can't remember if this is different from other cells or not.
--
Steve
_______________________________________________
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