Hello,

Take a look at "setIntercellSpacing:" in NSTableView Class Reference.
The default intercell spacing is (3.0, 2.0), so it may explains the
delta you see.

Regards, Laurent Etiemble.

Monobjc : A .NET/Objective-C Bridge
More info at http://www.monobjc.net/

2009/6/29 Nor <[email protected]>:
> Although total of the widths should be the same as the width in-between the
> left edge of the scrollview and the right edge minus the width of the
> vertical scroller,
> so although it should see all columns fully, the most right column can't see
> it whole content unless mouse-wheeling right.
>
>
> The following code is all I wrote. I put an NSTableView on a window which
> came in the Cocoa Application template, and an object which was called
> MyTableSizer.
>
> @interface MyTableSizer : NSObject {
>  IBOutlet NSTableView* _tableview;
> }
> @end
>
> @implementation MyTableSizer
> - (void) awakeFromNib
> {
>  float aScrollViewWidth = NSWidth([[_tableview enclosingScrollView]
> frame]);
>  float aTableViewWidth = aScrollViewWidth - [NSScroller scrollerWidth];
>
>  NSLog (@"ScrollView width : %f", aScrollViewWidth);
>  NSLog (@"TableView width  : %f", aTableViewWidth);
>
>  NSEnumerator* enm = [[NSArray arrayWithArray:[_tableview tableColumns]]
> objectEnumerator];
>  id col;
>  while (col = [enm nextObject])
> [_tableview removeTableColumn:col];
>
>
>  int counter = 5;
>  float quotient = aTableViewWidth / counter;
>  NSLog (@"Each Column's width: %f", quotient);
>  while (counter > 0)
>  {
> NSTableColumn* col = [[NSTableColumn alloc] initWithIdentifier:
>                     [NSString stringWithFormat:@"%d",counter]];
> [col setWidth:quotient];
> [_tableview addTableColumn:[col autorelease]];
> counter--;
>  }
> }
> @end
>
> That's all.
>
> The TableSizer is allocated and initialized in Nib file.
>
>
> 2009-06-29 18:06:47.302 TEST[2649:813] ScrollView width : 480.000000
> 2009-06-29 18:06:47.304 TEST[2649:813] TableView width  : 465.000000
> 2009-06-29 18:06:47.305 TEST[2649:813] Each Column's width: 93.000000
>
>
> The log seems to be correct, but actual tableview is actually wider.
>
> What do you think I'm missing?
>
> Any suggestions, advices, and workarounds would be very appreciated. I
> really need our help.
>
> Thank you,
> Norio
> _______________________________________________
>
> Cocoa-dev mailing list ([email protected])
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/laurent.etiemble%40gmail.com
>
> This email sent to [email protected]
>
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to