http://www.newton-inc.com/dev/techinfo/qa/qa.htm
protoUpDownScroller
on an Apple MessagePad 2000 , tapping on the scroller once calls the viewScroll2DScript
two or three times. Shouldn't the scroller call the script only once per tap? viewScroll2DScript
once per tap, but rather calls it repeatedly while the pen is held down over the scroll arrow. This is normal scroller behavior, and has in fact been there all along. with the MP2000, the processor is so much faster that it can chug through many scroll operations before the pen is released.while not StrokeDone(unit) do targetView:viewScroll2dscript(....)"
. If it takes even 1 tick for the StrokeDone
function to report true, it's possible that the viewScroll2DScript
might have been called more than once.viewScroll2DScript
. Use the global function Sleep
for this, as that call will yeild the NewtonScript task and let other parts of the OS work (or sleep the processor, saving battery power.) constant kMaxScrollSpeed := 60; // ticks viewScroll2DScript: func(...) begin local t := ticks(); ... // do scrolling stuff RefreshViews(); // show scrolled result Sleep(MAX(kMaxScrollSpeed - (ticks() - t), 0)); end;