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 (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to