[Pythonmac-SIG] Learning Python example

Luc Lefebvre lefebvre@med.mcgill.ca
Fri, 17 Mar 2000 14:02:32 -0500


Hi,

<newbie warning on>
I trie the following example from the "Learning Python" book:

# code begin
from Tkinter import *
w=Button(text="Hello", command='exit')

w.pack()
w.mainloop()

# code end

When I do this in Linux, all is peachy.  When I try this in the Mac version
the button shows up but when I click the button the widget seems to lock up
and I can't quit Python (I have to kill the whole IDE, command-Q doesn't
work).  I noticed in the Guido (vanRossum) and Matt examples supplied with
the distro that they bury all of this in a procedure as well as define a
toplevel widget to contain the button (which is not in this example).  I
can see the difference but don't quite understand why the above doesn't
work.

tia

-------------------------------
Luc Lefebvre
project engineer
Aerospace Medical Research Unit
McGill University
Montreal Canada

-----BEGIN PGP PUBLIC KEY BLOCK-----
Available upon request or public keyservers.
key fingerprint:
D2E5 5E35 B910 6F4E 0242  EC63 0FD9 96D0 C7F4 784E
-----END PGP PUBLIC KEY BLOCK-----