RE: fill tableview exactly with tablecolumns
RE: fill tableview exactly with tablecolumns
- Subject: RE: fill tableview exactly with tablecolumns
- From: "Hog Bay Software" <email@hidden>
- Date: Mon, 09 Jun 2003 14:35:01 -0000
>
If an NSTableView is to have exactly n NSTableColumns, what is the magic
>
formula for the width of each column such that the columns will *exactly*
>
fill the space from the left side to the right side - i.e., so that there
>
will be no white blob at the right and so that the horizontal scrollbar is
>
not activated and not needed?
>
>
I have been experimenting but I can't quite hit on it. Depending on the
>
number of columns, I always come out a little too wide or a little too
>
narrow. It's as if a rounding error (a big rounding error) is happening
>
behind the scenes.
Matt,
Was this issue ever resolved?
I also can't get my columns to line up either. In the my custom sizeToFit method I'm
1. getting the size of my visible rect
3. calling setWidth: on each column dividing up the visiblerect.width - (3 * numColumns) size evenly.
4. calling setFrame with the visible rect size on myself
5. calling tile
(what am I missing?)
This seems to work much of the time, but Im still having problems where last column in the header view does not match up with the clip view. This leaves an annoying vertical grey line.
Also when the table views frame is resized the table views columns only get updated periodically. Is there a way to turn this off so that the new column layout is displayed on every frame change? I realized this may be slower, but Im hoping it can help me debug my problem.
As an aside is there any effort underway to make the sources of the public cocoa classes available just as the public java classes are available? With the sources this question and many others could be quickly answered by taking a glance at NSTableView.m and seeing the correct way that it should be done. This would save me LOTS of time, and I think make OS X development much easier for all. This is my only real regret as a cocoa programmer.
Thanks,
Jesse
_______________________________________________
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.