Skip to Main Content
Learning Perl/Tk
book

Learning Perl/Tk

by Nancy Walsh
January 1999
Beginner content levelBeginner
373 pages
9h 43m
English
O'Reilly Media, Inc.
Content preview from Learning Perl/Tk

9.20. Scanning

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.

9.20.1. Scrolling Methods

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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Perl/Tk

Mastering Perl/Tk

Stephen Lidie, Nancy Walsh

Publisher Resources

ISBN: 1565923146Supplemental ContentCatalog PageErrata