From: Guido van Rossum Date: Wed, 21 Aug 1996 23:38:59 +0000 (+0000) Subject: Added a small test program. X-Git-Tag: v1.4b3~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c417ef8e57be01d0e2cbb255a0e8bd2fff5c4cd3;p=thirdparty%2FPython%2Fcpython.git Added a small test program. --- diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index cc2316e56224..5cab21d6af31 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -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: diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py index cc2316e56224..5cab21d6af31 100755 --- a/Lib/tkinter/Tkinter.py +++ b/Lib/tkinter/Tkinter.py @@ -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: