Don't reference removed files in Makefile
[python/dscho.git] / Demo / tkinter / matt / window-creation-simple.py
blobd881abef65d5fb38e979027c7dc07a75a88f54e6
1 from Tkinter import *
3 # this shows how to spawn off new windows at a button press
5 class Test(Frame):
6 def printit(self):
7 print "hi"
9 def makeWindow(self):
10 fred = Toplevel()
11 fred.label = Label(fred, {'text': "Here's a new window",})
12 fred.label.pack()
14 def createWidgets(self):
15 self.QUIT = Button(self, {'text': 'QUIT',
16 'fg': 'red',
17 'command': self.quit})
19 self.QUIT.pack({'side': 'left', 'fill': 'both'})
22 # a hello button
23 self.hi_there = Button(self, {'text': 'Make a New Window',
24 'command' : self.makeWindow})
25 self.hi_there.pack({'side': 'left'})
28 def __init__(self, master=None):
29 Frame.__init__(self, master)
30 Pack.config(self)
31 self.createWidgets()
33 test = Test()
34 test.mainloop()