Resizing NSWindows and NSViews with NSViewAnimation
Resizing NSWindows and NSViews with NSViewAnimation
- Subject: Resizing NSWindows and NSViews with NSViewAnimation
- From: Sanford Selznick <email@hidden>
- Date: Thu, 18 Oct 2007 10:47:28 -0700
At 10:39 AM -0700 10/18/07, Sanford Selznick wrote:
Hello,
Is there a trick to moving and resizing views while also resizing
the window? It's as if the origin is getting messed up as the
window resizes and the animation is getting confused.
There is, actually. ;-)
First I tried removing all springs from the window's objects. This
made all views position properly. But the animation with
NSViewAnimation was horrible.
What I did instead was change the springs and struts at run-time with
[myView setAutoresizingMask:mask]. Then I changed the frame of the
window with [window setFrame:newFrame display:YES animate:YES].
This works really well, and it's many fewer lines than
NSViewAnimation. At least when resizing windows is involved. (I
guess this only works if the resizing/moving is proportional to the
window size.)
I hope this helps somebody.
Best,
Sanford
_______________________________________________
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