Smooth fast scrolling programatically
Smooth fast scrolling programatically
- Subject: Smooth fast scrolling programatically
- From: Rolf <email@hidden>
- Date: Mon, 26 May 2003 12:17:26 +0200
Hi,
My app has a panel with a (wide) NSIMageView inside a (narrow) NSScrollView. The NSImageView is supposed to scroll smoothly and quickly inside the NSScrollView from one end to the other (horizontally). The range is around 300 pixels. The problem is that the scrolling is not as smooth
as I'd like - its actually quite jerky (on a G4 667 MHz). The app is performing no other tasks while the scrolling is going on. What can be done to create a perfectly smooth (& quick) scrolling ?
This is how it's done now:
Scrolling:
NSClipView * clip = [scrSlidingImage contentView]; // scrSlidingImage is the NSScrollView
[clip scrollToPoint:NSMakePoint(iSlidingImageCurrentPos,0)]; // The iSlidingImageCurrentPos is incremented by 1 for each timer tick
Timer:
FtmrSlidingImage = [[NSTimer scheduledTimerWithTimeInterval:0.01
target:self selector:@selector(timerSlidingImage)
userInfo:nil repeats:YES] retain];
I have also tried using a delay instead of NSTimer with the same result (reasonably fast but jerky movement):
[self performSelector: @selector(timerSlidingImage) withObject: nil afterDelay: 0.01];
/Rolf
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.