blob: c8ebfa750d23e0169e8030aed05f994721c46a6f [file] [log] [blame]
Guido van Rossum35820f71994-10-07 09:55:26 +00001from Tkinter import *
2
3# this program creates a canvas and puts a single polygon on the canvas
4
5class Test(Frame):
6 def printit(self):
7 print "hi"
8
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'})
14
15 self.draw = Canvas(self, {"width" : "5i", "height" : "5i"})
16
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")
19
20 self.draw.pack({'side': 'left'})
21
22
23 def __init__(self, master=None):
24 Frame.__init__(self, master)
25 Pack.config(self)
26 self.createWidgets()
27
28test = Test()
29
30test.mainloop()