
Using mercury_tcltk is not all that different to using Tcl/Tk itself,
except that all operations are done in Mercury instead of Tcl.
See the samples for example code, and the interfaces of
`mtk.m' and `mtcltk.m'. Note that we don't consider these modules
fully documented in any way, but if you know Tcl/Tk, you shouldn't
have any problems.

The main tricky thing is that it is *CRUCIAL* that you link with a
version of the garbage collection library (libgc.a or libgc.so) which
has been compiled with `-DALL_INTERIOR_POINTERS'.  You can create
this by typing the commands

	make clean
	make libgc.a libgc.so EXTRA_CFLAGS=-DALL_INTERIOR_POINTERS

in the boehm_gc directory of the Mercury compiler source distribution.

You also need to add some information to your Mmakefile to tell mmake where
the mercury_tcltk library is, and to link with the mercury_tcltk, tcl,
tk and X libraries.

The following is an example. You may need to change the `tk8.0' and
`tcl8.0' if you are using a different version of Tcl/Tk, and don't
forget to change `some/directory' to the directory where this package
is installed.

	TCLTK_MLLIBS  = -ltk8.0 -ltcl8.0 -L/usr/X11R6/lib -lX11 -lXmu \
				-lXext -lm -ldl

	# Specify the location of the `mercury_tcltk' package.
	MERCURY_TCLTK_DIR  = some/directory/mercury_tcltk

	# Tell mmake to use the `mercury_tcltk' library.
	VPATH           = $(MERCURY_TCLTK_DIR):$(MMAKE_VPATH)
	MCFLAGS         = -I$(MERCURY_TCLTK_DIR) $(EXTRA_MCFLAGS)
	MLFLAGS         = -R$(MERCURY_TCLTK_DIR) $(EXTRA_MLFLAGS) \
			  -L$(MERCURY_TCLTK_DIR) 
	MLLIBS          = -lmercury_tcltk $(TCLTK_MLLIBS) $(EXTRA_MLLIBS)
	C2INITFLAGS     = $(MERCURY_TCLTK_DIR)/mercury_tcltk.init 

	# Tell ml to link with our specially-compiled version of
	# the libgc library instead of the usual one.
	MLFLAGS	+= -L some/other/directory/boehm_gc

You can then use EXTRA_MCFLAGS, EXTRA_MLFLAGS, etc to set any other
options you need.

