Question

I'm running Windows 8. I have a file named "test.tcl".

  • If I open a shell, type "wish", then 2 windows open. In one of them, I can type Tcl code and open the file test.tcl. If I open this file, its code is executed.
  • If I double click on test.tcl to open the file with "Wish Application", then 1 blank window open, and nothing happens.

Do you know why please?

Was it helpful?

Solution

On Windows, Wish is built as a GUI-only application; it has no real standard output available. Tk fakes one for you though; just put this in your script to show the fake console:

console show

The fake console shows up by default when you launch without a script file, but launching with a script file doesn't show it (so your script file can implement an application, of course).

This can catch people out when they produce a lot of output on stdout. Tk may well be keeping it all faithfully just in case the code does console show later on, though it looks and smells a lot like a memory leak if you're not prepared for it…

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top