Re: NSTableView modifications
Re: NSTableView modifications
- Subject: Re: NSTableView modifications
- From: Brian Webster <email@hidden>
- Date: Wed, 15 Jan 2003 23:20:37 -0600
On Wednesday, January 15, 2003, at 10:31 PM,
email@hidden wrote:
I have a NSTableView that I would like to tweak in a way I have not
seen done.
I would like to change the height of the NSTableHeaderView enough so
that
I can display text in the NSTableHeaderCells rotated by -90 degrees.
so I need to get the NSTableHeaderCell to draw text with an arbitrary
rotation, I'm guessing using an NSAffineTransform?
and I need to change the height of the NSTableHeaderView to accommodate
the length (height?) of the rotated text.
As far as actually drawing the text goes, yes, using an
NSAffineTransform, or some of the convenient coordinate transformation
methods in NSView would be the best way to draw the text vertically.
Naturally, you'd implement this in a subclass of NSTableHeaderCell.
Configuring the table might be a bit of a trick. The reason is that
the table view you drag into a window in IB is actually a fairly
complex hierarchy with several different views. The outermost view is
a scroll view that contains four subviews: a clip view that contains
the actual table view, an NSScroller, another clip view that contains
the NSTableHeaderView, and the corner view. To change the height of
the header, you actually need to change the height of the clip view
that encloses it, along with keeping the corner view the same height.
And, of course, you need to keep the other clip view and the scroller
aligned correctly so that they all fit in the scroll view. I'll leave
the coding of it up to the reader, as it would basically be a bunch of
pain in the butt calculations and setFrame: calls.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.