[Tutor] ComboBox with Tkinter
klappnase at freenet.de
Sat Jul 17 17:18:47 CEST 2004
On Fri, 16 Jul 2004 20:50:45 -0700
Dick Moores <rdm at rcblue.com> wrote:
> "last update: Dec 10, 1999"
> No problem?
I know, it's a little outdated, but for the most part it's still o.k.
The parts that have changed since 1999 mostly affect a couple of new widgets
in the standard library (LabelFrame, PanedWidget, OptionMenu...) and some new options
that were added (like the "compound" option for labels and buttons) but everything (or at least almost
everything) from this book should still work.
Frederic Lundh is currently working on an updated version of this document:
but it's not yet as complete as the old version.
> 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:
> from Tkinter import *
> class App:
> def __init__(self, master):
> frame = Frame(master)
> self.button = Button(frame, text="QUIT", fg="red",
> self.hi_there = Button(frame, text="Hello", command=self.say_hi)
> def say_hi(self):
> print "hi there, everyone!"
> root = Tk()
> app = App(root)
This works fine for me; maybe you tried to run it from within IDLE? It's a special IDLE issue
that using the quit() method does not work; quit() exits Tk's mainloop, and the problem is that
IDLE runs inside the mainloop itself.
More information about the Tutor