Added more cross-reference targets and tidied up list of useful handlers.
[python.git] / Demo / tkinter / matt / packer-simple.py
blobf55f1bee723e650c3c0b5f7712476606c42f8caa
1 from Tkinter import *
4 class Test(Frame):
5 def printit(self):
6 print self.hi_there["command"]
8 def createWidgets(self):
9 # a hello button
10 self.QUIT = Button(self, text='QUIT', foreground='red',
11 command=self.quit)
12 self.QUIT.pack(side=LEFT, fill=BOTH)
14 self.hi_there = Button(self, text='Hello',
15 command=self.printit)
16 self.hi_there.pack(side=LEFT)
18 # note how Packer defaults to side=TOP
20 self.guy2 = Button(self, text='button 2')
21 self.guy2.pack()
23 self.guy3 = Button(self, text='button 3')
24 self.guy3.pack()
26 def __init__(self, master=None):
27 Frame.__init__(self, master)
28 Pack.config(self)
29 self.createWidgets()
31 test = Test()
32 test.mainloop()