| 4640 | |
| 4641 | |
| 4642 | def _test(): |
| 4643 | root = Tk() |
| 4644 | text = "This is Tcl/Tk %s" % root.globalgetvar('tk_patchLevel') |
| 4645 | text += "\nThis should be a cedilla: \xe7" |
| 4646 | label = Label(root, text=text) |
| 4647 | label.pack() |
| 4648 | test = Button(root, text="Click me!", |
| 4649 | command=lambda root=root: root.test.configure( |
| 4650 | text="[%s]" % root.test['text'])) |
| 4651 | test.pack() |
| 4652 | root.test = test |
| 4653 | quit = Button(root, text="QUIT", command=root.destroy) |
| 4654 | quit.pack() |
| 4655 | # The following three commands are needed so the window pops |
| 4656 | # up on top on Windows... |
| 4657 | root.iconify() |
| 4658 | root.update() |
| 4659 | root.deiconify() |
| 4660 | root.mainloop() |
| 4661 | |
| 4662 | |
| 4663 | __all__ = [name for name, obj in globals().items() |