Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I close default wish window?

Status
Not open for further replies.

jekahab18

Programmer
Jul 31, 2008
3
IL
Hi,
I'm a Tcl/Tk newbie. I'm writing a console script in Tcl which must run in Linux and Windows.

In Linux the script is run by tclsh because of the
#!/usr/bin/tclsh
directive in the first line.
In Windows I use ActiveTcl which by default associates Tcl script with wish. So every script opens an empty Tk window even without any Tk commands.
How can I prevent this window from appearing (or kill it right after script starts)?

Thanks.

 
Hi

If the file association is wrong, why not change the file association ?

Otherwise you can use this in [tt]wish[/tt], but of course will generate error in [tt]tclsh[/tt] :
Code:
wm state . withdrawn

Feherke.
 
The problem with tclsh in Windows is that the console closes in case of an error. So it's quite a problem to understand what happened: the script finished its job or aborted because of an error.

Is there a way to prevent tclsh console from closing if my script has an error?
 
From Tcl Manual:
The only errors that are not caught are syntax errors found when the script is compiled.

:(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top