| Revision: | 8 |
| Committed: | Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges |
| Content type: | text/x-python |
| Original Path: | Python/NinoCode/learning/tk1.py |
| File size: | 365 byte(s) |
| Log Message: | Initial Import |
| # | Content |
|---|---|
| 1 | from Tkinter import * |
| 2 | def doit(): |
| 3 | print "hello" |
| 4 | |
| 5 | def gui(master): |
| 6 | top = Frame(master) |
| 7 | top.pack() |
| 8 | # the key to the command thing is to not put the () after the function call. |
| 9 | button = Button(top, text = "press me", command = doit) |
| 10 | button.pack(side=BOTTOM) |
| 11 | if __name__ == "__main__": |
| 12 | root = Tk() |
| 13 | gui(root) |
| 14 | mainloop() |