[Pythonmac-SIG] OptionMenu widget crashes the interpreter

Craig Hagerman craig@osa.att.ne.jp
Mon, 20 Mar 2000 16:40:42 +0900


Hi,

I am wondering if there is a known bug involving using an OptionMenu
Tkinter widget on Macs. I was just trying to make a simple GUI front end
for a script and decided to use a pop-up menu rather than radio buttons to
select between two options. I have used almost exactly the same code as the
"optionmenu.py" script in the 'tkinter->guido' folders in the standard Mac
distribution.

With both my GUI and with the script from the 'guido' folder I end up
crashing the Python interpreter about 80 % of the time. (Sometimes
everything runs without a hitch.) It usually results in a "type 2" error
message.

The "optionmenu.py" only imports Tkinter, however I don't see any reference
to this widget in Fredrik Lundh's online "An Introdution to Tkinter". I did
discover a reference to it in the new book "Python and Tkinter Programming"
(John E. Grayson) within the PMW (Python Mega Widgets) section. However I
don't seem to have a PMW module in my Mac distribution. Am I correct in
assuming this is not available on the Mac platform? If so why?

So what is going on with the OptionMenu widget? Is it a PWM widget or not?
If it is a PWM widget why does it display correctly but then crash my
machine? Is there a better way to contruct a pop-up menu?

Thanks in advance,

Craig Hagerman