• 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: "Sean McBride" <email@hidden>
  • Date: Thu, 16 Dec 2004 19:59:45 -0500

Jonathon Mah (email@hidden) on Thu, Dec 16, 2004 3:41 AM said:

>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.

Works great, thanks!  So obvious in retrospect too. :)

>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.

That should probably work, but instead I used [[[self window]
contentView] subviews] to iterate though all the window's views, saved
all their autoresizingMask values, resized the window, then restored all
the autoresizingMasks.

Thanks!

--
"But if the answer isn't violence, neither is your silence" - Pop Will
Eat Itself


 _______________________________________________
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

References: 
 >Re: Controlling control sizes when programatically resizing a window (From: Jonathon Mah <email@hidden>)

  • Prev by Date: Examples of custom controls that support bindings
  • Next by Date: Re: Using alerts with Preference Panes
  • Previous by thread: Re: Controlling control sizes when programatically resizing a window
  • Next by thread: Stacking run loops
  • Index(es):
    • Date
    • Thread