Frequently Asked Questions about TkWin 1. What is it? TkWin is a port of Ousterhout's Tcl/Tk package to Microsoft Windows 3.1. It was developed by the Mathematical Sciences Computing Facility at the University of Kentucky; the first release appeared July 4, 1994. There is an update available dated July 20, 1994. 2. Where do you get it? TkWin can be obtained via anonymous ftp from ftp.ms.uky.edu in /pub/tk-win. The current version of the sources is tkwin.zip; the binaries are in tkwinbin.zip. Mirrors are at ftp.ibp.fr:/pub/tcl/tk-win mrrl.lut.ac.uk:/tcl-tk/tk-win 3. How do you execute Tcl/Tk commands from a file? Because there is no shell and so no "#!" convention, Tcl scripts cannot be directly executed. You need to specify the executable in the command line. For example: wish -f /myscripts/myfile.tcl -t -c where you can drop off the -t if your script doesn't make tcp connections and can drop -c if you don't care to have a console window (the console window is mostly for debugging). The above command line can be typed into the Program Manager's File/Run menu option or you can make a program item with it using File/New. If you already have a wish running with a console window, you can also simply type in the command source /myscripts/myfile.tcl You can also use the File Manager. To do this, first use File Manager File/Run to run regedit. Choose Edit/Add Filetype and fill in the entry. For example, you could use Identifier: tclfile, File Type: Tcl/Tk Script, Command: wish -t -f %1, and click on Uses DDE to de-select it; then hit OK to register the new type, and exit from regedit. From the File manager, select File/Associate. Fill in TCL as the extension and select the Tcl/Tk Script Filetype to associate it with; click OK. Now you should be able to click on .tcl files in the File Manager and have them run wish -t -f on them. 4. Are there size limitations in TkWin? There are at least two sources of size limitations. First, integers are 16 bit integers. Typically, this is not a problem but because the code came from a 32 and 64 bit world, it would have been easy to have overlooked some places where 32 bits are needed. In fact, there are some places where I know that 32 bits would have been preferable, but decided to stay with plain 16 bit ints because of the effect on the code. Second, TCL.DLL is a large model library with most things occurring in the local heap. This means that data structures in general and especially strings are certainly limited to 64K. In practice, I have found that things tend to break down when objects get larger than about half that size (though I do not know where this occurs). There are similar limitations on file i/o, which is serious because Tcl/Tk tends to want to read in files in a single read. In particular, you probably don't want to source large files; break them up first. 5. What limitations are there on the Windows screen? TkWin was developed on a 486 machine with 16 MB memory and a video controller with 1 MB. It has been tried on 386 machines with half the memory and video controllers with only 256K; it did work, but... One recommends: First, that you set your screen resolution to 1024 x 768 (or finer) if at all possible. This is the resolution where almost all testing has occurred; it also is close to the typical resolution of low end Unix workstations, where many Tk applications were developed. Second, try to maximize the color depth. In general, 16 bit works fine; 8 bits is tolerable, and 4 bits looks odd. This is because the colors are being approximated by what happens to already be in the palette, rather than by generating the exact new colors. Quite often on 8 bit and 4 bit screens colors will appear as stippled patterns; this is being done by the display driver, and not the tcl code, and so is machine dependent. 6. Known problems as of July 20, 1994 a. The console window doesn't display output of stdout and stderr. b. There are problems under Windows for Workgroups. Amongst other things, apparently buttons do not work properly. At the moment I don't have a copy of WFW to work with...