Re: Customizing NSTableViewHeader.. I think I got it.
Re: Customizing NSTableViewHeader.. I think I got it.
- Subject: Re: Customizing NSTableViewHeader.. I think I got it.
- From: Gustavo Pizano <email@hidden>
- Date: Sun, 20 Dec 2009 20:55:37 +0100
.. I think I got it... I overwrote the mouseDown method from NSResponder, and the sorting doesn't happen... so I guess I must aim my efforts starting form this method.
I will let you know my progress.
G.
On Dec 20, 2009, at 5:30 PM, Gustavo Pizano wrote:
> Hello,
> After reading some post, and coding my own class, I was able to set up a custom glossy background color, then I realize the title was behind it, so I just place it above the background..
>
> So, so far so good.
>
> But now when I click in the header of a column, of course because its a custom one, no highlight color appear... (yes the light aqua blue color) and also the sort indicator.. all this seems to be under the background.. I have been trying to check different approaches like, in the drawRect of the CustomNSTableHeaderView method, when sending to draw each column headerCell (which are subclasses also), check if the column is selected, of course this will "work", if I have column selection enable, not my case, I also tried, directly in the headerCell, checking if isHiglighted, but always returns NO. So unless Im able to know where exactly I can check if the user clicked the column header, to place the sort indicator or call the method - (void)drawSortIndicatorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView ascending:(BOOL)ascending priority:(NSInteger)priority; on the HeaderCell, I can't draw the background color for highlighted neither the sort indicator.
> I tried also to override, the method :
> - (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView:(NSView *)controlView
>
> but it was never called.
>
> Any ideas?
>
> Thanks
>
> Gustavo
>
_______________________________________________
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