Re: Filling gradient in NSTableHeaderView not working properly
Re: Filling gradient in NSTableHeaderView not working properly
- Subject: Re: Filling gradient in NSTableHeaderView not working properly
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 13 Dec 2011 10:29:31 -0700
On Dec 13, 2011, at 8:09 AM, Devarshi Kulshreshtha wrote:
> So earlier it was appearing like this-
>
> http://db.tt/PVE9rnXu<http://www.google.com/url?sa=D&q=http://db.tt/PVE9rnXu&usg=AFQjCNEIuYicJ1GFjsSvZcX0sqWsacM94g>
>
>
> Now it is appearing like this-
>
> http://db.tt/D1zrJJJa<http://www.google.com/url?sa=D&q=http://db.tt/D1zrJJJa&usg=AFQjCNEV4NOJZ4OehohH4aQmXMeFpfZk3A>
I'm getting 404s when loading those URLs.
> As shown in above screen-shot, when I used this code I faced few problems:
>
> 1. Column header titles are not getting displayed.
> 2. Header column separators are not appearing.
>
> Can anyone suggest me how to resolve these problems or some better way to
> implement it?
Don't override -[NSTableHeaderView drawRect:] if you want to change the appearance of a table header. Instead, subclass NSTableHeaderCell and override -drawWithFrame:inView: and -highlight:withFrame:inView: to do your custom background drawing. In the overrides, you can call -drawInteriorWithFrame:inView: with an inset frame in order to draw the column header titles. To use it, set the header cell in each NSTableColumn.
You'll still need to draw the separator lines yourself, though. Thankfully, that is easy to do using NSBezierPath.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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