source: trunk/essentials/dev-lang/python/Demo/tkinter/matt/rubber-line-demo-1.py

Last change on this file was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 1.9 KB
Line 
1from Tkinter import *
2
3class Test(Frame):
4 def printit(self):
5 print "hi"
6
7 def createWidgets(self):
8 self.QUIT = Button(self, text='QUIT',
9 background='red',
10 foreground='white',
11 height=3,
12 command=self.quit)
13 self.QUIT.pack(side=BOTTOM, fill=BOTH)
14
15 self.canvasObject = Canvas(self, width="5i", height="5i")
16 self.canvasObject.pack(side=LEFT)
17
18 def mouseDown(self, event):
19 # canvas x and y take the screen coords from the event and translate
20 # them into the coordinate system of the canvas object