[Pythonmac-SIG] "A GUI Test Session" from Learning Python Crashes

Kimlynnae Pleticha stank005@tc.umn.edu
Sat, 2 Oct 1999 10:51:14 -0500


At 2:58 PM -0700 10/1/99, Joseph J. Strout wrote:
>At 4:00 PM -0500 10/01/99, Brian J. Stankiewicz wrote:
>
>>Okay, I have done some more testing ont he problem and here are some more
>>symptoms that I am finding.  If I run one of the Demos
>>(Demo:tkinter:Matt:Canvas-demo-sipmple.py) from the IDE I get the tk window
>>displayed, but when I hit the "quit" button the Python completely freezes.
>>However, if I run the same program by simply double-clicking on the .py
>>file and running it in the Python interpretor only, it runs just fine and
>>will quit gracefully.
>
>This is not too surprising.  The IDE has its own menu bar.  Tk has
>its own menu bar.  When you run a Tk program from within the IDE,
>Tk's menu bar clobbers that of the IDE.  When the Tk program quits,
>there is no longer a valid menu bar, and the Mac goes off in search
>of one and never comes back.  ;)  (Actually, it probably just shoots
>itself.)

Hmmm.  I have to admit that this IS surprising to me.  The IDE is a great
environment to help debug code in, but it seems to me that it should be a
bit more stable. Is there a way to create Tk code so that it doesn't
clobber the IDE menu bar when it quits?  Or is there a way to change the
code in the IDE so that when running other Tk code the menu bar will not
get clobbered?   What methods have others used for writing Python Tk code?

Thanks,
-Brian