| 5072 | |
| 5073 | |
| 5074 | def _test(): |
| 5075 | root = Tk() |
| 5076 | text = "This is Tcl/Tk %s" % root.globalgetvar('tk_patchLevel') |
| 5077 | text += "\nThis should be a cedilla: \xe7" |
| 5078 | label = Label(root, text=text) |
| 5079 | label.pack() |
| 5080 | test = Button(root, text="Click me!", |
| 5081 | command=lambda root=root: root.test.configure( |
| 5082 | text="[%s]" % root.test['text'])) |
| 5083 | test.pack() |
| 5084 | root.test = test |
| 5085 | quit = Button(root, text="QUIT", command=root.destroy) |
| 5086 | quit.pack() |
| 5087 | # The following three commands are needed so the window pops |
| 5088 | # up on top on Windows... |
| 5089 | root.iconify() |
| 5090 | root.update() |
| 5091 | root.deiconify() |
| 5092 | root.mainloop() |
| 5093 | |
| 5094 | |
| 5095 | __all__ = [name for name, obj in globals().items() |