[Tkinter-discuss] Trouble quitting a Tkinter app on Windows

Russell E. Owen rowen at cesmail.net
Fri Mar 17 19:54:56 CET 2006


I have a Python/Tkinter application that runs on various platforms. When 
the user selects "quit", I call root.quit() or sys.exit(0) (newer vs. 
older version of the code). This works on all platforms except Windows.

On Windows when the user quits (which calls quit on the root toplevel), 
it always exits with the following error 
dialog:

This application has requested the Runtime to terminate it in an unusual 
way.
Please contact the application"s support team for more information.

A google search shows that others have had this problem -- especially 
PMW users -- but nobody seems to understand why. I posted to the tk 
newsgroup and was told that tk users don't see this problem, so it may 
be a Tkinter bug.

One user suggested calling root.destroy() first. That does work but it 
takes a surprisingly long time as each toplevel in turn is destroyed. 
(It is nearly instantaneous on other platforms, but also unnecessary).

My application (a telescope control GUI) has many toplevels, uses tkFont 
objects to manage display fonts and has a few background tasks (that use 
"after"). I don't know if any of these are relevant, but I certainly get 
the feeling that simpler applications don't show the problem.

Any ideas? Should I file a Tkinter bug report?

-- Russell



More information about the Tkinter-discuss mailing list