[Tutor] ComboBox with Tkinter

Dick Moores rdm at rcblue.com
Sat Jul 17 05:50:45 CEST 2004


Michael Lange wrote at 17:50 7/16/2004:
>If you need some documentation for the standard Tkinter module you can 
>start with Frederic Lundh's
>excellent "Introduction to Tkinter" 
>(<http://www.pythonware.com/library/tkinter/introduction/>)

"last update: Dec 10, 1999"

No problem?

For example, I just ran his hello2.py. The Hello button works, but the 
Quit button doesn't quit. Or maybe I don't understand even enough to run 
these things. I have Python 2.3.4.

===================================
# File: 
hello2.py 
#<http://www.pythonware.com/library/tkinter/introduction/hello-again.htm>

from Tkinter import *

class App:

     def __init__(self, master):

         frame = Frame(master)
         frame.pack()

         self.button = Button(frame, text="QUIT", fg="red", 
command=frame.quit)
         self.button.pack(side=LEFT)

         self.hi_there = Button(frame, text="Hello", command=self.say_hi)
         self.hi_there.pack(side=LEFT)

     def say_hi(self):
         print "hi there, everyone!"

root = Tk()

app = App(root)

root.mainloop()
=========================================


Dick Moores



More information about the Tutor mailing list