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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

basic tcl installation problem

Status
Not open for further replies.

InesW

Technical User
May 14, 2018
5
DE
Hello there,

I am new to tcl and simply trying to install a complete program (this one: I work on Windows 10 and have currently installed Tcl 8.5.18.0 - x86. The Woz-program (woz.tcl) used to run a few months ago and now I am puzzled to see that it does not do so anymore.

When starting woz.tcl from the command line, at least I get an error: "This program requires wish!". The reason why I am puzzled is that I do have a wish.exe and wish85.exe in C:\Tcl\bin (this path has also been added to the environment variables). When I looked into the source code of woz.tcl, I realized, that I can't quite figure out all of the syntax:

# check tk availability
if {[info commands button]==""} {
puts "FATAL ERROR:\n\nThis program requires wish!"
exit
}

So maybe someone can help me

A) by explaining what "[info commands button]" means on a syntactic level (it seems to be checking if wish exists, but I don't know where exactly it is looking)
B) by giving me a hint what wish-files I should have other than wish.exe and where they should be placed.

Thank you so much!

Best, Ines
 
I am using a different version of TCL - where did you get your TCL from?
 
Did you check if TCL is in your PATH?
IMO, the simplest solution would be to reinstall TCL on your Windows - it takes you only some minutes.
First uninstall old TCL and install new. Anyway, the version 8.5 is already old. The proper version for windows is [url ]ActiveTCL[/url].
 
This is where I got TCL from
I need a 32bit version because I will later install tcom which did not work on 64bit. So I have the choice between 8.6.6.8607 and 8.5.18.0. It turns out that 8.6.6.8607 does not come with teacup (which I need for downloading packets like tcom).

So after a lot of installing and uninstalling several different versions I am left with 8.5.18.0. that "should" have what I need but the problem described in my question persists. Even the newest version of Tcl 8.6.7.0 raises the problem.

I added the paths C:\Tcl\bin AND C:\ActiveTcl\bin (different path for the other version) both to my user variables and my system variables. This path is also where wish.exe is located so TCL and wish "should" be traceable.

What about the "[info commands button]" - any ideas where that piece of code looks to get a value?

Thnx
 
Somehow I managed to solve this. There was an init file the tcl-script referred to and in which paths had to be customized. So now tcl knows where to find wish.

Thanks for your effort.
 
as described here info commands <pattern> return list of command specified by the pattern
In your case the command button is not found so the list is empty and you get the error message.

It could have several causes:

1. I don't understand why you have 2 paths for tcl, i.e. C:\Tcl\bin and C:\ActiveTcl\bin ?
Maybe you mix 2 versions, one installed properly and other not.
I have ActiveTcl installed by default in the C:\ActiveTcl directory and have in the PATH only C:\ActiveTcl\bin

2. It seems that your script runs in tclsh and not in wish:
When I take this piece of code
inesw.tcl
Code:
if {[info commands button]==""} {
  puts "Wish not used"
} else {
  pack [button .hello -text "Wish is available" -command { exit }]
}
and run it on command line in tclsh I get similar message like you:
Code:
c:\>tclsh inesw.tcl
Wish not used

But when I run it on command line in wish
Code:
c:\>wish inesw.tcl
then the button with the message appears:

inesw_pkv75d.jpg


When I simply double click on the script inesw.tcl, it will be automatically opened with wish and the button appears (like on the screenshot but without command line window).

It seems that something gone wrong with your Tcl installation on Windows ...
Didn't you changed file association in your windows, so that the files with the extension *.tcl should be opened by tclsh ?
 
InesW said:
Somehow I managed to solve this. There was an init file the tcl-script referred to and in which paths had to be customized. So now tcl knows where to find wish.
OK
 
I haven't looked but it is strange that the latest versions do not have teacup. It is normally in the same directory as tclsh and wish.
 
Now I checked teacup on 2 Windows machines at my work. On both ActiveTcl 8.6. is installed.
On the older machine I found Win32 version and teacup is present in the Tcl\bin directory and works.
On the newer machine I found x64 version and teacup is not available.
So really, who wants to use teacup needs Win32 version.
 
mikrom said:
1. I don't understand why you have 2 paths for tcl, i.e. C:\Tcl\bin and C:\ActiveTcl\bin ?
Maybe you mix 2 versions, one installed properly and other not.

I have been switching back and forth between different versions (one at a time). So I added the path for each version and left it there even after uninstalling that version.

mikrom said:
Didn't you changed file association in your windows, so that the files with the extension *.tcl should be opened by tclsh?

Yes, I set *.tcl to be opened by tclsh by default. This is still the case now (after solving the wish-error). I will have to meditate on this a little more.

Thanks for your help. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top