Tall NSTableView Column Headers
Tall NSTableView Column Headers
- Subject: Tall NSTableView Column Headers
- From: Keith Renz <email@hidden>
- Date: Thu, 21 Oct 2004 17:00:17 -0400
I need a NSTableView with tall column headers to accommodate 2 lines of
text. I previously received a reply (sorry, lost the reply) which said
I should subclass NSTableHeaderView and override headerRectOfColumn:.
This does not work. I have, in fact, subclassed NSTableHeaderView and
replaced my nib's NSTableView's header view with my new
NSTableHeaderView subclass. Overriding initWithFrame: with a taller
frame allows space for a taller header, but the standard header view is
being drawn centered vertically in the new space. So, what I end up
with is a taller header (white space) with the standard header drawn in
the middle. This means that I also need to override NSTableHeaderCell
(which does the drawing), and I have done so. Unfortunately, there is
still no way to get the standard "look" as it appears to be a private
theme drawing method. I realize that, in my NSTableHeaderCell subclass,
I must override NSCell's drawWithFrame:inView:,
drawInteriorWithFrame:inView:, highlight:withFrame:inView: and possibly
other methods. This is a lot of work for something seemingly straight
forward. You can easily set a table view's row height, but not the
header height -- doesn't make sense. I've checked the archives and
can't find anything similar. If anyone knows a easier way to do this or
can point me to some sample code, I'd be grateful.
Thanks,
Keith
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden