January 1999
Beginner
373 pages
9h 43m
English
Use the scan method to implement scanning of the canvas:
$canvas->scanMark(x,y); $canvas->scanDragto(x,y);
The first call, $canvas->scanMark(x, y), records the x and y coordinates and the current canvas view. The second call, $canvas->scanDragto(x, y), causes the view in the canvas to be adjusted by 10 times the difference between these coordinates and the previous ones sent with scanMark. This makes the canvas look as if it was moved at high speed.
The canvas widget can be scrolled both horizontally and vertically. The methods xview and yview are used to communicate with the scrollbars. See Chapter 6 for more information on how these methods work.