×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

basic tcl installation problem

basic tcl installation problem

basic tcl installation problem

(OP)
Hello there,

I am new to tcl and simply trying to install a complete program (this one: http://www.softdoc.de/woz/). 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

RE: basic tcl installation problem

I am using a different version of TCL - where did you get your TCL from?

RE: basic tcl installation problem

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 ActiveTCL.

RE: basic tcl installation problem

(OP)
This is where I got TCL from https://www.activestate.com/activetcl/downloads.

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

RE: basic tcl installation problem

(OP)
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.

RE: basic tcl installation problem

as described here https://www.tcl.tk/man/tcl8.0/TclCmd/info.htm#M8
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:



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 ?

RE: basic tcl installation problem

Quote (InesW)


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

RE: basic tcl installation problem

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.

RE: basic tcl installation problem

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.

RE: basic tcl installation problem

(OP)

Quote (mikrom)

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.

Quote (mikrom)

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. :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close