Skip to content

Commit c417ef8

Browse files
committed
Added a small test program.
1 parent c1d5053 commit c417ef8

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

Lib/lib-tk/Tkinter.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,25 @@ def __init__(self, master=None, cnf={}, **kw):
15661566
self['fg'] = self['bg']
15671567
self['activebackground'] = self['bg']
15681568

1569+
######################################################################
1570+
# Test:
1571+
1572+
def _test():
1573+
root = Tk()
1574+
label = Label(root, text="Proof-of-existence test for Tk")
1575+
label.pack()
1576+
test = Button(root, text="Click me!",
1577+
command=lambda root=root: root.test.config(
1578+
text="[%s]" % root.test['text']))
1579+
test.pack()
1580+
root.test = test
1581+
quit = Button(root, text="QUIT", command=root.destroy)
1582+
quit.pack()
1583+
root.mainloop()
1584+
1585+
if __name__ == '__main__':
1586+
_test()
1587+
15691588

15701589
# Emacs cruft
15711590
# Local Variables:

Lib/tkinter/Tkinter.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,25 @@ def __init__(self, master=None, cnf={}, **kw):
15661566
self['fg'] = self['bg']
15671567
self['activebackground'] = self['bg']
15681568

1569+
######################################################################
1570+
# Test:
1571+
1572+
def _test():
1573+
root = Tk()
1574+
label = Label(root, text="Proof-of-existence test for Tk")
1575+
label.pack()
1576+
test = Button(root, text="Click me!",
1577+
command=lambda root=root: root.test.config(
1578+
text="[%s]" % root.test['text']))
1579+
test.pack()
1580+
root.test = test
1581+
quit = Button(root, text="QUIT", command=root.destroy)
1582+
quit.pack()
1583+
root.mainloop()
1584+
1585+
if __name__ == '__main__':
1586+
_test()
1587+
15691588

15701589
# Emacs cruft
15711590
# Local Variables:

0 commit comments

Comments
 (0)