Reputation: 418
we just ran into problems related to Tcl and Tk differences.
We have a testing tool for transfered xml data using the tcltest framework.
General program flow:
read in xml-file and generate DOM tree (using tdom)
running the tests (using tcltest, tests generate logging output, i.e. setting an array with the relevant information)
read and process logging information
prepare latex file with logging info
generate pdf using pdflatex
In a new test we want to include a graphic into the document. So we load Tk in the test-setup, prepare the graph on a canvas and write the canvas to a file. This all works fine in a stand-alone test program.
But integrated into the application we observe, that the test is performed and the program ends without an error at the end of the testfile, but never returns to the main program to perform the last three steps.??? If the remaining code of the application is sourced into the test-file, the program execution continues properly. Anybody an idea what might go wrong?
Thanks in advance joachim
Upvotes: 0
Views: 93
Reputation: 137557
When you load Tk, it installs a handler which runs the event loop after your script finishes executing. This is because this is how the wish
program has worked for at least 20 years; Tcl is (logically) used to set up the application and handle callbacks. For most GUI applications, this is absolutely fine. In your case not.
You should put an explicit exit
at the end of your script once you've finished generating the output you want.
Upvotes: 1