Re: tcl/tk on Windows: "This application has requested the Runtime to terminate it in an unusual way" on quit



Russell E. Owen wrote:
In article <1141868998.793262.235610@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"slebetman@xxxxxxxxx" <slebetman@xxxxxxxxx> wrote:

Russell E. Owen wrote:
I have an application that uses Tk and runs on various platforms. On
Windows 2000 (I don't know about XP) 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.
I assume you mean calling the 'exit' command. Otherwise please show us
the proc 'quit' that you've written.

My program is actually written in Python using its standard tk interface "Tkinter". Typically Tkinter is a very thin layer over tk, but in this case it's not a direct translation (probably because Tkinter users must explicitly start tk's even loop, and quit shuts it down again). The more typical way to exit any Python program (with or without Tkinter) is to call sys.exit() and indeed that works just the same (i.e. badly on Windows) as explicitly quitting Tk's even loop.

I have found one way to get my program to exit gracefully on Windows: explicitly destroy the root toplevel (a hint found via a google search, and that came with no explanation) before exiting.

That works, but it's quite slow. One sees each toplevel going away, rather slowly, one at a time. i suspect tk is recursively destroying the child widgets. Anyway, my Windows users will just have to live with it.

I'm curious if tcl/tk programmers have seen this -- i.e. can you safely "exit" from a tcl/tk program on windows if you have multiple toplevels and some background stuff happening (via "after", not threads)? If so, this may be a Tkinter bug, not a tk bug.

-- Russell

I've used Tcl/Tk on Windows for years and have never seen this error message -- and have had programs exit via destroying "." as well as calling exit (both done with multiple toplevels). So, to me it sounds like a Tkinter bug.

P.S. I've also never seen the windows go away slowly when exiting when using Tcl/Tk.

--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.



Relevant Pages

  • Re: tcl/tk on Windows: "This application has requested the Runtime to terminate it in an unusual way
    ... I assume you mean calling the 'exit' command. ... the proc 'quit' that you've written. ... Windows) as explicitly quitting Tk's even loop. ... explicitly destroy the root toplevel (a hint found via a google search, ...
    (comp.lang.tcl)
  • Re: Exceptional Error
    ... to exit above the top directory. ... Kevin Spencer ... and the bicycle has to *want* to change. ... I am using IIS in Windows XP. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to set exit code of non-console app?
    ... say I have an app called "MyApp" with the following Main function: ... So it's clear from my tests that the exit code for a Windows application is ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to set exit code of non-console app?
    ... As I understand it the result of Mainis the application's exit code. ... I don't know what you mean by "Windows applications exit immediately, ... >code and this particular application expects that the program it launches ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Link windows to another toplevel
    ... > canvas and other toplevel windows. ... > My application creates a canvas where I draw several things .. ... > to destroy them within the proc DestroyAllOtherWindows ...
    (comp.lang.tcl)