[Tutor] Exiting a Tkinter Program-- An Anomaly or two

Wayne Watson sierra_mtnview at sbcglobal.net
Thu Feb 11 12:38:51 CET 2010


Well, I found where I had tucked away my inbox mail folder for tkinter.
Somehow it got to be a subfolder of another list. It hadn't been used by 
me for months. The short of this is that I posted to tkinter, and have a 
better understanding of this now. In fact, fixed it by using sys.exit() 
in the def.

On 2/9/2010 6:00 PM, Wayne Watson wrote:
> I'm looking a 1800+ line someone else wrote. It uses one large dialog 
> for menus, and has a large area for images. A few menus open small 
> dialogs, for example, to enter a file name. The File menu has an exit 
> choice. The only other exit is the x in the upper right corner of the 
> large dialog. I'm pretty sure that menu is coded to quit via a shoft 
> def in the program.
>
> def Quit(self)
>    self.running = False
>    self.master.quit()
>
> I see no other code to quit. If I use Exit, the program does not 
> quite. If I then use the x, it quits and the shell script is left open 
> for a command. Any ideas why Quit doesn't work? It's accessible  via a
> self.mainMenu.add_command(.. command=self.Quit)
> I  had not turned the program loose by using a menu or touching any 
> controls.
>
> If I cause the program to print to the shell, and then use x to exit 
> that it hangs the shell. Why? When I x the shell, it tells me  the 
> prog is running. Do I want to kill it. Yes,kills the shell  window.
>
> The above seem abnormal to me. Comments?
>

-- 
"Crime is way down. War is declining. And that's far from the good 
news." -- Steven Pinker (and other sources) Why is this true, but yet 
the media says otherwise? The media knows very well how to manipulate us 
(see limbic, emotion, $$). -- WTW


More information about the Tutor mailing list