Hi Randall

On 09.12.2008, at 04:14, Randall Meadows wrote:

I have configured a view .xib with an NSTableView; I load the nib and add the table view to another parent view. I've implemented the necessary delegate and data source methods. It's all working just peachy, except...

It's placement in the parent view is wrong, and I can't figure out how to place it correctly.

In the .xib file, I've configured all 4 exterior sizing connections to be struts, both interior sizing connections to be springs, for the view, the scrollview, and the table view.

[NSBundle loadNibNamed:@"FlexViewTable" owner:self];
[view addSubview:tableView];

The view's frame is taken from the nib file, meaning whenever you resize
the view's layout window in IB it will encode its size in the nib file.

Simply set the frame of the tableview before adding it as a subview:

[NSBundle loadNibNamed:@"FlexViewTable" owner:self];
[tableView setFrame:[view frame]];
[view addSubview:tableView];

Ofcourse you can create a new frame based on the superview's frame by
using NSMakeRect or similar.

Regards,
Patrick

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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