Re: Controlling control sizes when programatically resizing a window
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