• 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
Problem with NSViewAnimation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with NSViewAnimation


  • Subject: Problem with NSViewAnimation
  • From: Ankuj Gupta <email@hidden>
  • Date: Thu, 11 Apr 2013 12:57:34 +0530

Hi

I am trying to slide up a NSWindow when a button is pressed. I used
NSViewAnimation to do so. The code I wrote is

               NSRect _saveRect = [macWindow  frame];

                NSRect _zeroRect = _saveRect;

                NSSize orignalSize(_saveRect.size);

                _zeroRect.size = NSMakeSize(0, 0);


                NSDictionary *fadeInAttrs = [NSDictionary
dictionaryWithObjectsAndKeys:
                    macWindow, NSViewAnimationTargetKey,
                    [NSValue valueWithRect:_zeroRect],
NSViewAnimationStartFrameKey,
                    [NSValue valueWithRect:_saveRect],
NSViewAnimationEndFrameKey,
                    nil];

                NSViewAnimation *_viewAnimIn = [[NSViewAnimation alloc]
initWithViewAnimations:[NSArray arrayWithObjects: fadeInAttrs, nil]];

                [_viewAnimIn setDuration:1.0];
                [_viewAnimIn startAnimation];

where macWindow is an NSWindow. This code animates the window but both
vertically and horizontally.

But I want only vertical animation so I changed the targetFrameKey to

                      _zeroRect.size = NSMakeSize(saveRect.size.width, 0);
keeping other parameters same. But after this change the window is not
animating.

What am I doing wrong here ?

Ankuj
_______________________________________________

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

  • Prev by Date: Simple Vector Based Line Charts
  • Next by Date: Re: UICollectionViewCell
  • Previous by thread: Re: Simple Vector Based Line Charts
  • Next by thread: presentViewController completion block usage
  • Index(es):
    • Date
    • Thread