'lo, On 2 Sep 2011, at 06:54, Indragie Karunaratne wrote:
> This has been asked a few times before, but not after Lion was released so I > figured I'd ask again. Is there any way to animate the scroll point of an > NSScrollView? I figure that animation must be possible somehow, considering > that inertial scrolling is basically animating the scroll point. I expected > to see new API's in Lion for this, but there seems to be nothing that was > added to NSScrollView that would enable me to easily do this. The only way > that comes to mind is to use an NSTimer to create an animation of sorts, but > I imagine that this wouldn't perform too well and that it wouldn't look very > smooth either. You can simply animate the bounds-rectangle of the scrollview's clipview, e.g. [NSAnimationContext beginGrouping]; NSClipView* clipView = [[_myView enclosingScrollView] contentView]; NSPoint newOrigin = [clipView bounds].origin; newOrigin.x = MY_NEW_POSITION; [[clipView animator] setBoundsOrigin:newOrigin]; [NSAnimationContext endGrouping]; Daniel._______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com