mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Added a small test program.
This commit is contained in:
parent
c1d5053882
commit
c417ef8e57
2 changed files with 38 additions and 0 deletions
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue