Hi,
I just made the autoscroll challenge on ImageFun.
The autoscrolling supposed to be controlled by a timer every tenth of a second. In My case the work seems to be done but I have experienced one side effect, maybe a bug.
The side effect is following:
When I press the mouse down and move it outside the window the view is scrolled smoothly controlled by the timer. All looks fine, but when I keep the mouseDown outside the window and do not dragg it for some seconds the scroll image will move to the begining of the view. If I move the mouse it will immediatly moved as it should. .
The autoscroll method is invoked by the timer,while the timer is started from mouseDown: method. The timer is invalidated in mouseUp:
The invoked method looks like this
Would it be a problem that the scrollNow is invoked all the time even while the mouse is not moving at all and thus the clever system finds out that maybe it is a time to reset the scroller back to start ?
Any idea would be appreciated, speciall from those of you who are working on Hillegass cocoa programming book.
/petron
I just made the autoscroll challenge on ImageFun.
The autoscrolling supposed to be controlled by a timer every tenth of a second. In My case the work seems to be done but I have experienced one side effect, maybe a bug.
The side effect is following:
When I press the mouse down and move it outside the window the view is scrolled smoothly controlled by the timer. All looks fine, but when I keep the mouseDown outside the window and do not dragg it for some seconds the scroll image will move to the begining of the view. If I move the mouse it will immediatly moved as it should. .
The autoscroll method is invoked by the timer,while the timer is started from mouseDown: method. The timer is invalidated in mouseUp:
The invoked method looks like this
HTML:
- (void)scrollNow
{
NSEvent *event = [NSApp currentEvent];
[self autoscroll:event];
[self setNeedsDisplay:YES];
}
Would it be a problem that the scrollNow is invoked all the time even while the mouse is not moving at all and thus the clever system finds out that maybe it is a time to reset the scroller back to start ?
Any idea would be appreciated, speciall from those of you who are working on Hillegass cocoa programming book.
/petron