]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added a small test program.
authorGuido van Rossum <guido@python.org>
Wed, 21 Aug 1996 23:38:59 +0000 (23:38 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 21 Aug 1996 23:38:59 +0000 (23:38 +0000)
Lib/lib-tk/Tkinter.py
Lib/tkinter/Tkinter.py

index cc2316e562245dd5257720245f94c0dc662e18eb..5cab21d6af31b93db0ffba0499d2308a30fd1736 100644 (file)
@@ -1566,6 +1566,25 @@ class Tributton(Button):
                self['fg']               = self['bg']
                self['activebackground'] = self['bg']
 
+######################################################################
+# Test:
+
+def _test():
+       root = Tk()
+       label = Label(root, text="Proof-of-existence test for Tk")
+       label.pack()
+       test = Button(root, text="Click me!",
+                     command=lambda root=root: root.test.config(
+                             text="[%s]" % root.test['text']))
+       test.pack()
+       root.test = test
+       quit = Button(root, text="QUIT", command=root.destroy)
+       quit.pack()
+       root.mainloop()
+
+if __name__ == '__main__':
+       _test()
+
 
 # Emacs cruft
 # Local Variables:
index cc2316e562245dd5257720245f94c0dc662e18eb..5cab21d6af31b93db0ffba0499d2308a30fd1736 100755 (executable)
@@ -1566,6 +1566,25 @@ class Tributton(Button):
                self['fg']               = self['bg']
                self['activebackground'] = self['bg']
 
+######################################################################
+# Test:
+
+def _test():
+       root = Tk()
+       label = Label(root, text="Proof-of-existence test for Tk")
+       label.pack()
+       test = Button(root, text="Click me!",
+                     command=lambda root=root: root.test.config(
+                             text="[%s]" % root.test['text']))
+       test.pack()
+       root.test = test
+       quit = Button(root, text="QUIT", command=root.destroy)
+       quit.pack()
+       root.mainloop()
+
+if __name__ == '__main__':
+       _test()
+
 
 # Emacs cruft
 # Local Variables: