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 protected])
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]