• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSBox sizeToFit problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSBox sizeToFit problem
      • From: Reinhard Segeler <email@hidden>
    • Re: NSBox sizeToFit problem
      • From: Reinhard Segeler <email@hidden>
    • Re: NSBox sizeToFit problem
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: Avoid drawing in half pixel
  • Next by Date: Re: Avoid drawing in half pixel
  • Previous by thread: Re: Utility/Floating window with titlebar on left side
  • Next by thread: Re: NSBox sizeToFit problem
  • Index(es):
    • Date
    • Thread