source:
vendor/python/2.5/Demo/tkinter/matt/canvas-moving-w-mouse.py
| Last change on this file was 3225, checked in by , 19 years ago | |
|---|---|
| File size: 2.1 KB | |
| Rev | Line | |
|---|---|---|
| [3225] | 1 | from Tkinter import * |
| 2 | ||
| 3 | # this file demonstrates the movement of a single canvas item under mouse control | |
| 4 | ||
| 5 | class Test(Frame): | |
| 6 | ################################################################### | |
| 7 | ###### Event callbacks for THE CANVAS (not the stuff drawn on it) | |
| 8 | ################################################################### | |
| 9 | def mouseDown(self, event): | |
| 10 | # remember where the mouse went down | |
| 11 | self.lastx = event.x | |
| 12 | self.lasty = event.y | |
| 13 | ||
