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



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
.



Relevant Pages

  • Re: tcl/tk on Windows: "This application has requested the Runtime to terminate it in an unusual way
    ... the proc 'quit' that you've written. ... The more typical way to exit any Python program is to call sys.exitand 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 before exiting. ...
    (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: CLISP [1]> ?
    ... Use the usual editing capabilities. ... or (exit) leaves CLISP. ...
    (comp.lang.lisp)
  • 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: Observations from a Windows user
    ... these were genuine first impressions from a Windows going ... We don't use a window close function to quit a program, ... hugh at clarity point uk point co ... Simply messing about. ...
    (uk.comp.sys.mac)