Attempting to create NSTableView with Single Header
Attempting to create NSTableView with Single Header
- Subject: Attempting to create NSTableView with Single Header
- From: "Brent Fulgham" <email@hidden>
- Date: Tue, 20 May 2008 16:11:15 -0700
I have been trying to create a two-column NSTableView with a single
"spanned" column header. The idea here is to allow a static set of
labels on the left-hand column, with values on the right-hand side.
For example, in ASCII art:
| My single column header |
| Label 1 | Value 1 |
| Label 2 | Value 2 |
... etc. ...
I'm not sure how to do this. I don't see any options in IB to merge
the two header elements into a single value. Since the
NSTableHeaderView seems to span the entire range of area I wish to
draw, I can't adjust its bounds to accomplish what I want.
I also tried a few things such as:
1. Make the second column's header Cell nil, in the hope that the
table view would just draw the first column cell. But with a 'nil'
header cell for the second column I got a run-time crash:
NSTableColumn* secondCol = [infoTableView tableColumnWithIdentifier:
@"value_column"];
[secondCol setHeaderCell: nil];
2. The NSCell doesn't seem to provide much control over the drawing
of the header information (there is no associated NSRect or other
dimensional information I could change).
Does anyone have any ideas for how to accomplish this?
Thanks,
-Brent
_______________________________________________
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