I'm trying to have a superview resize itself to match the bounds of a subview 
when the subview is added.  When I do, the superview bounds become NaN.

Why would this:

- (void)didAddSubview:(NSView *)view
{
    // resize to match bounds of given subview
    NSLog(@"%@ = %@, %@ = %@", self, NSStringFromRect([self bounds]), view, 
NSStringFromRect([view bounds]));
    [self setBounds:[view bounds]];
    NSLog(@"%@ = %@, %@ = %@", self, NSStringFromRect([self bounds]), view, 
NSStringFromRect([view bounds]));
}

result in this?

2012-02-13 09:48:03.637 LSSettingsBar[3797:707] <MCView: 0x100184ba0> = {{0, 
0}, {0, 0}}, <NSView: 0x100189340> = {{0, 0}, {216, 216}}
2012-02-13 09:48:03.637 LSSettingsBar[3797:707] <MCView: 0x100184ba0> = {{nan, 
nan}, {nan, nan}}, <NSView: 0x100189340> = {{0, 0}, {216, 216}}

-Michael
_______________________________________________

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

This email sent to arch...@mail-archive.com

Reply via email to