Resizing Table Column Headers
Resizing Table Column Headers
- Subject: Resizing Table Column Headers
- From: Mike Wright <email@hidden>
- Date: Mon, 4 Oct 2004 18:25:35 -0700
I have an NSTableView that begins life in a Nib file, set to 12-point
Helvetica.
Users can change the font for the table view, and I use -setRowHeight
to change the row height to fit the new font size. However, this
doesn't seem to affect the height of the column header cells. As a
result, the header titles get clipped when set to a larger font.
I've experimented with a custom NSTableHeaderCell, and can enlarge the
header cells appropriately, but after many hours of trying this and
that, I can't get the bling-blanged things to draw their frame
properly. The frame is drawn with the original height, even though
-drawingRectForBounds returns the correct frame rect, and
-drawWithFrame and -drawInteriorWithFrame call super with the correct
frame (in my custom NSTableHeaderCell).
The result is that the title is drawn in a properly sized rectangle,
but a small frame outline, suitable for 12-point Helvetica, is drawn
centered in the cell, on top of the title text. (If I set a background
color for the header cell, that works fine, and wipes out the small
outline, but still leaves me with no outline around the actual cells.)
Is it the NSTableHeaderCell that is drawing the cell outline? If not,
what is drawing it, and how do I access it? I had thought that it might
be NSTableHeaderView, but haven't been able to spot anything there.
Any clues? It seems odd to have the header completely divorced from the
rest of the column. While it's nice to be able to have special headers,
it seems to me that the default should be that one should track the
other in terms of style.
Can someone please show me the error of my ways?
Thanks,
Mike Wright
_______________________________________________
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