Flicer while using NSViewAnimation for roll down
Flicer while using NSViewAnimation for roll down
- Subject: Flicer while using NSViewAnimation for roll down
- From: Ankuj Gupta <email@hidden>
- Date: Tue, 16 Apr 2013 17:26:49 +0530
Hi
I am trying to slide down a NSWindow using NSViewAnimation. I am using the
following code
NSRect firstViewFrame = [macWindow frame];
NSViewAnimation *theAnim;
NSRect newViewFrame;
NSMutableDictionary* firstViewDict;
NSMutableDictionary* secondViewDict;
NSRect newRect(firstViewFrame);
newRect.size.height = 0;
firstViewDict = [NSMutableDictionary
dictionaryWithCapacity:3];
// Specify which view to modify.
[firstViewDict setObject:macWindow
forKey:NSViewAnimationTargetKey];
[firstViewDict setObject:[NSValue valueWithRect:newRect]
forKey:NSViewAnimationStartFrameKey];
[firstViewDict setObject:[NSValue
valueWithRect:firstViewFrame]
forKey:NSViewAnimationEndFrameKey];
// Create the view animation object.
theAnim = [[NSViewAnimation alloc]
initWithViewAnimations:[NSArray
arrayWithObjects:firstViewDict, nil]];
// Set some additional attributes for the animation.
[theAnim setDuration:0.4]; // One and a half seconds.
[theAnim setAnimationCurve:NSAnimationEaseIn];
[theAnim setAnimationBlockingMode:NSAnimationBlocking];
// Run the animation.
[theAnim startAnimation];
// [macWindow setFrame:newViewFrame display:YES
animate:YES];
// The animation has finished, so go ahead and release it.
[theAnim release];
But I see a flicker while animation is going. Is is because I am using the
rect with zero height as starting position or is their some other issue. Is
there some other apis which I can use for animating NSWindow ?
Thanks
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