Re: Modifying TableHeaderCell
Re: Modifying TableHeaderCell
- Subject: Re: Modifying TableHeaderCell
- From: Mark Allan <email@hidden>
- Date: Wed, 2 Dec 2009 21:26:06 +0000
On 2 Dec 2009, at 11:51 am, Gustavo Pizano wrote:
Hello, I know this has been asked, but the answers I have found on
internet even gave me a light of what to do, i still can't
accomplish what I want.
I subclassed NSTableHeaderView, NSTableHeaderCell, NSTableView then
I make the table header to be class of my custom class. Then I read
that to modify the height of the cell I must override these methods:
- (NSRect)titleRectForBounds:(NSRect)theRect ;
and
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView
*)controlView ;
I did so, making in the first method returning a rect with the
desired dimensions. then on the awakefromnib of the custom class of
NSTableView, I assign to the colum headder cell, an instance of my
custom NSTableHeaderCell.
now in my custom NSTableHeaderView., in the drawRect method, Im
drawing the propper background, and of course, I need to get the
title of the cell to create a rect and draw the rect above the
background, otherwise it will be not shown because its bellow.
But anyway.. Im a little bit confused on what should I do to make
this work, Im still looking for examples, some of them showed me how
to setup the background on the header, but I hadn't found anything
to make the header bigger in height.
Have a look at Matt Gemmell's code called iTableColumnHeader. You'll
find it at http://mattgemmell.com/source
I don't think it changes the height of the header, but it's very easy
to modify it to your needs.
Mark
_______________________________________________
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