Commits

Guido van Rossum  committed a5a8266

Added a small test program.

  • Participants
  • Parent commits 9569664
  • Branches legacy-trunk

Comments (0)

Files changed (2)

File Lib/lib-tk/Tkinter.py

 		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:

File Lib/tkinter/Tkinter.py

 		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: