• 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
Re: Controlling control sizes when programatically resizing a window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Controlling control sizes when programatically resizing a window


  • Subject: Re: Controlling control sizes when programatically resizing a window
  • From: Jonathon Mah <email@hidden>
  • Date: Thu, 16 Dec 2004 19:11:22 +1030

On 16 Dec 2004, at 17:20, Sean McBride wrote:

You will probably find that locking the springs to the top of your window
and leaving them floating at the bottom means that when the window resizes
the objects all shuffle down correctly.

I don't find this to be the case, but I'm not sure I understand you, or
perhaps you have misunderstood me. It's one of those things that's
easier to see than write about. :) So I've made a simple example and put
it here:
<http://www.cam.org/~cwatson/CocoaTestBed.sitx>


Maybe you could take a quick look?

Normally, you want your springs set up the way they are - which causes the tableview to resize as the window resizes. Calling -[NSWindow setFrame:display:] resizes the window just as if the user had resized it, honoring all the springs you set up. To temporarily resize the window in a different way, you can tell the controls to change their autoresizing (i.e. springs) behavior, resize the window, then set the springs back how they were.


Take a look at this: (I was unsure if I should attach this to the list, but at 15kb, I didn't see any reason not to.)

Attachment: CocoaTestBed-Fixed.sitx
Description: Binary data




If you have a lot of objects above the area you want to shrink, you could probably put them all into an NSBox, with the springs set on width and height (but none on position). When you want to remove the area, you only need to change the resizing behavior of the NSBox, do the resize, then set the NSBox springs back.


(I say "probably" because I've never tried it.)



Jonathon Mah
email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Controlling control sizes when programatically resizing a window
      • From: "Sean McBride" <email@hidden>
References: 
 >Re: Controlling control sizes when programatically resizing a window (From: Andrew White <email@hidden>)
 >Re: Controlling control sizes when programatically resizing a window (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: Controlling control sizes when programatically resizing a window
  • Next by Date: Re: NSImage lockFocus in DrawRect while printing
  • Previous by thread: Re: Controlling control sizes when programatically resizing a window
  • Next by thread: Re: Controlling control sizes when programatically resizing a window
  • Index(es):
    • Date
    • Thread