Problem with NSViewAnimation
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