• 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
Resizing NSWindows and NSViews with NSViewAnimation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Resizing NSWindows and NSViews with NSViewAnimation
      • From: Florent Pillet <email@hidden>
  • Prev by Date: Re: Trouble using createFileAtPath method to create file (revisited)
  • Next by Date: Re: Trouble using createFileAtPath method to create file (revisited)
  • Previous by thread: Resizing NSWindows and NSViews with NSViewAnimation
  • Next by thread: Re: Resizing NSWindows and NSViews with NSViewAnimation
  • Index(es):
    • Date
    • Thread