Tk 4.1 for Windows

by Scott Stanton
Sun Microsystems Laboratories
scott.stanton@eng.sun.com


Binary release
--------------

In addition to the source release, there is also a binary release for
Windows that contains precompiled versions of tcl75.dll, tk41.dll,
wish41.exe and the rest of the runtime environment.  This release
comes as a self-extracting setup.exe file that will take care of
correctly installing Tcl and Tk under the directory of your choice.
Look for the binary release in the same location as the source
release.  For most users, the binary release will be much easier to
install and use.  You only need the source release if you plan to
modify the core of Tcl, or if you need to compile with a different
compiler.  With the addition of the dynamic loading interface, it is
no longer necessary to have the source distribution in order to build
and use extensions.

Porting Notes
-------------

This is the directory where you compile Windows versions of Tk.  This
directory also contains source files for Tk that are specific to
Windows.  Tk should compile under both Borland C++ 4.5 and Visual C++
2.0.  The resulting binaries are suitable for use under all versions
of Windows that have the Win32 API (including Windows 3.1 with
Win32s).

Furthermore, please feel free to send me any notes you might make
about porting to other compilers so I may include them in this file
for others to reference.

How To Compile And Install Tk:
-------------------------------

After compiling and installing Tcl, 

(a) Read the section above about the binary release.

(b) Check for patches as described in ../README.

(c) To compile with Borland C++ 4.5:

	Edit "makefile.bc" to update the TMPDIR and TOOLS macros to
	reflect your directory structure, then type:

		make -f makefile.bc

	In order to use the makefile as it is supplied, you will need
	to have a number of Unix-like utilities.  We are currently
	using the MKS Toolkit, although the GNU-ish tools would
	probably work as well.  The rule to automatically generate the
	.def file from the .obj files is the primary offender.
	Unfortunately none of the "_export" mechanisms work for Tcl,
	so we need to extract the list of symbols in a post-processing
	step.  The Visual C++ version of the makefile has a program
	call "dumpexts.exe" which does this post-processing.  If
	someone creates an equivalent program for BC++ object files, I
	would gladly use it instead of the existing method.

    To compile with Visual C++ 2.0:

	Edit "makefile.vc" to update the TMPDIR and TOOLS
	macros to reflect your directory structure, then type:

		nmake -f makefile.vc

	Note that the header files that come with VC++ 2.0 are out of
	date and should be replaced with the header files from the
	developer network CDs or later releases of VC++.

(d) Copy the "tk41.dll" and "wish41.exe" files to your binary
    installation directory (e.g.  c:\tcl\bin)

(e) Copy the files in ../library to a directory called "lib\tk4.1"
    (e.g. c:\tcl\lib\tk4.1)

(f) If you do not put the library files in a directory that is
    parallel with the location of the binary directory, then you will
    need to set the environment variable "TK_LIBRARY" to point to the
    actual location of the library files.

(g) At this point, you can play with Tk by invoking the "wish41"
    program and typing Tcl commands.

If you have trouble compiling Tk, check out the following Web URL:
    http://www.sunlabs.com/cgi-bin/tcl/info.4.0
This is an on-line database of porting information.  We make no guarantees
that this information is accurate, complete, or up-to-date, but you may
find it useful.  If you get Tcl running on a new configuration, we would
be happy to receive new information to add to "porting.notes".  You can
also make a new entry into the on-line Web database.  We're also interested
in hearing how to change the configuration setup so that Tcl compiles out
of the box on more platforms.

Test suite
----------

The Windows version of Tk does not pass many of the tests in the test
suite.  This is primarily due to dependencies in the test suite on the
size of particular X fonts, and other X related features.  We will be
working to develop a more general test suite for Tk under Windows, but
for now, you will not be able to pass many of the tests.

Known Bugs
----------

Here is the current list of known bugs/missing features for the
Windows alpha version of Tk:

- File events aren't implemented yet (coming soon).
- There is no support for custom cursors/application icons.
- Stippling of arcs isn't implemented yet.
- Alt-key sequences cause conflicts with Windows.  Tk will still see
  them, but the system rings the bell.
- The initial position of toplevel windows is always in the upper left
  corner, unless explicitly specified with "wm geometry".
- The initial size information of a toplevel window is wrong if the
  contents of the window are smaller than the minimum window size
  allowed by Windows.
- Some "wm" functions don't map to Windows and aren't implemented.
- There is no support for the option database yet.
- Under Win32s, you can only start one instance of Wish at a time.
- Traversin the items in a menubar causes the titlebar of the window
  to flash.


If you have comments or bug reports for the Windows version of Tcl,
please direct them to:

Scott Stanton
scott.stanton@eng.sun.com

or post them to the newsgroup comp.lang.tcl.
