The user can develop their own ECLiPSe application which uses the Tcl/Tk
interface to provide a graphical front end. The development tool suite was
designed to be independent of the tkeclipse top-level so that they can be
used in a user's application. In effect, the user can replace the tkeclipse
top-level with their own alternative top-level. Two simple examples in
which this is done is provided in the lib_tcl
library as
example.tcl
and example1.tcl
. In addition, tkeclipse
itself, in the file tkeclipse.pl
, can be seen as a more complex
example usage of the interface.
In order to use the Tcl/Tk interface, the system must be initialised as described in the Embedding manual. In addition, the user's Tcl code should probably also be provided as a package using Tcl's package facility, in order to allow the program to run in a different directory. See the Embedding manual and the example programs for more details on the initialisation needed.
The user should most likely provide a connection for the output stream
of ECLiPSe so that output from ECLiPSe will go somewhere in the GUI. In
addition, especially during the development, it is also useful to connect
the error stream to some window so that errors (such as ECLiPSe
compilation errors) are seen by the user. This can be done using the
ec_queue_connect
Tcl command described in the embedding manual.
Output from ECLiPSe need not be sent to a Tk window directly. The Tcl/Tk code which receives the output can operate on it before displaying it. It is intended that all such graphical operations should be performed on the Tcl side, rather than having some primitives provided on the ECLiPSe side.
The user can also provide balloon-help to his/her own application. The balloon help package is part of the Megawidget developed by Jeffrey Hobbs and used in tkeclipse. In order to define a balloon help for a particular widget, the following Tcl code is needed:
balloonhelp <path> <text>
where <path>
is the pathname of the widget, and <text>
is the
text that the user wants to display in the balloon.