NSBox sizeToFit problem
NSBox sizeToFit problem
- Subject: NSBox sizeToFit problem
- From: Ingvar Nedrebo <email@hidden>
- Date: Thu, 6 May 2010 15:01:16 +0100
Hi all,
I'm seeing some strange behaviour using NSBox's sizeToFit method. When I send the message in my code, the box gets sized too small and clips it contents.
To make sure it wasn't anything to do with my app, I created a brand new test project, added a box to the main window, and put a couple of labels and buttons inside the box.
When I use Layout > Size to Fit in IB, the box is nicely fitted around its contents with proper margins as I would expect.
In the app delegate's applicationDidFinishLaunching method I then send a sizeToFit message to the box:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[box sizeToFit];
}
The result is that the box is sized too small and clips its contents. As this is a brand new project where I've added a single line of code, I'm not sure what I could be doing wrong. Is this method working as expected for anyone else?
Regards,
Ingvar
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden