(py-indent-right, py-outdent-left): new commands, bound to C-c C-r and
[python/dscho.git] / Demo / tkinter / matt / window-creation-w-location.py
blob8f9ad471cce1f680df9908972dbdf756f06502fb
1 from Tkinter import *
3 import sys
4 sys.path.append("/users/mjc4y/projects/python/tkinter/utils")
5 from TkinterUtils import *
7 # this shows how to create a new window with a button in it that can create new windows
10 class Test(Frame):
11 def makeWindow(self, *args):
12 fred = Toplevel()
14 fred.label = Canvas (fred, {"width" : "2i",
15 "height" : "2i"})
17 fred.label.create_line("0", "0", "2i", "2i")
18 fred.label.create_line("0", "2i", "2i", "0")
19 fred.label.pack()
21 centerWindow(fred, self.master)
23 def createWidgets(self):
24 self.QUIT = QuitButton(self)
25 self.QUIT.pack({'side': 'left', 'fill': 'both'})
28 self.makeWindow = Button(self, {'text': 'Make a New Window',
29 'width' : 50,
30 'height' : 20,
31 'command' : self.makeWindow})
32 self.makeWindow.pack({'side': 'left'})
34 def __init__(self, master=None):
35 Frame.__init__(self, master)
36 Pack.config(self)
37 self.createWidgets()
39 test = Test()
40 test.mainloop()