(py-indent-right, py-outdent-left): new commands, bound to C-c C-r and
[python/dscho.git] / Demo / tkinter / matt / canvas-demo-simple.py
blobc8ebfa750d23e0169e8030aed05f994721c46a6f
1 from Tkinter import *
3 # this program creates a canvas and puts a single polygon on the canvas
5 class Test(Frame):
6 def printit(self):
7 print "hi"
9 def createWidgets(self):
10 self.QUIT = Button(self, {'text': 'QUIT',
11 'fg': 'red',
12 'command': self.quit})
13 self.QUIT.pack({'side': 'bottom', 'fill': 'both'})
15 self.draw = Canvas(self, {"width" : "5i", "height" : "5i"})
17 # see the other demos for other ways of specifying coords for a polygon
18 self.draw.create_polygon("0i", "0i", "3i", "0i", "3i", "3i", "0i" , "3i")
20 self.draw.pack({'side': 'left'})
23 def __init__(self, master=None):
24 Frame.__init__(self, master)
25 Pack.config(self)
26 self.createWidgets()
28 test = Test()
30 test.mainloop()