| Revision: | 8 |
| Committed: | Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges |
| Content type: | text/x-python |
| File size: | 495 byte(s) |
| Log Message: | Initial Import |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | ninoborges | 8 | # File: hello2.py |
| 2 | |||
| 3 | from Tkinter import * | ||
| 4 | |||
| 5 | class App: | ||
| 6 | |||
| 7 | def __init__(self, master): | ||
| 8 | |||
| 9 | frame = Frame(master) | ||
| 10 | frame.pack() | ||
| 11 | |||
| 12 | self.button = Button(frame, text="QUIT", fg="red", command=frame.quit) | ||
| 13 | self.button.pack(side=LEFT) | ||
| 14 | |||
| 15 | self.hi_there = Button(frame, text="Hello", command=self.say_hi) | ||
| 16 | self.hi_there.pack(side=LEFT) | ||
| 17 | |||
| 18 | def say_hi(self): | ||
| 19 | print "hi there, everyone!" | ||
| 20 | |||
| 21 | root = Tk() | ||
| 22 | |||
| 23 | app = App(root) | ||
| 24 | |||
| 25 | root.mainloop() |