]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
This demo imported some private code from Matt. Make it cripple along.
authorGuido van Rossum <guido@python.org>
Thu, 8 Apr 1999 15:18:12 +0000 (15:18 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 8 Apr 1999 15:18:12 +0000 (15:18 +0000)
Demo/tkinter/matt/window-creation-w-location.py

index 795833530641f0c831bfc851360f6fd6381591ed..0ec4e094ec90eb91644715242bdb29bd125f2664 100644 (file)
@@ -1,12 +1,19 @@
 from Tkinter import *
 
 import sys
-sys.path.append("/users/mjc4y/projects/python/tkinter/utils")
-from TkinterUtils  import *
+##sys.path.append("/users/mjc4y/projects/python/tkinter/utils")
+##from TkinterUtils  import *
 
 # this shows how to create a new window with a button in it that
 # can create new windows
 
+class QuitButton(Button):
+    def __init__(self, master, *args, **kwargs):
+        if not kwargs.has_key("text"):
+            kwargs["text"] = "QUIT"
+        if not kwargs.has_key("command"):
+            kwargs["command"] = master.quit
+        apply(Button.__init__, (self, master) + args, kwargs)
 
 class Test(Frame):
     def makeWindow(self, *args):
@@ -18,7 +25,7 @@ class Test(Frame):
        fred.label.create_line("0", "2i", "2i", "0")
        fred.label.pack()
 
-       centerWindow(fred, self.master)
+       ##centerWindow(fred, self.master)
 
     def createWidgets(self):
        self.QUIT = QuitButton(self)