Florian Palita
Florian Palita

Reputation: 1

Tcl 8.5 Wish.exe spawns two windows (console + another window)

I just built tcl 8.5 from the sources provided and I'm starting a wish85/wish process.

Two windows are spawned, one of them being the actual console.

I want to know how to force this behavior: closing the console should close the process. I tried to force a handler for the WM_DELETE_WINDOW message but it doesn't seem to work.

Can you guys help?

Upvotes: 0

Views: 928

Answers (1)

Johannes Kuhn
Johannes Kuhn

Reputation: 15173

The console window runs in a different interp, so you have to install the protocol handler there. A way to do that is with

console eval {wm protocol . WM_DELETE_WINDOW exit}

The console implementation is in [file join $tk_library console.tcl] (on my system C:/Tcl/lib/tk8.6/console.tcl), if you want to mess around there (not recommended).

Upvotes: 2

Related Questions