Figures 6.1 and 6.2 shows a simple example of
the use of the interface. To try this program, the user should start an
ECLiPSe, compile the ECLiPSe program. This will suspend on the
remote_connect/3
, waiting for the Tcl program to attach. The Tcl
program should then be started on the same machine, and the attachment will
be connected using the fixed host and port address. During the
initialisation when attaching,
a from-ECLiPSe queue is created, which is set
to flush at every newline. This is done by an ec_rpc goal after the
queue is created. As no Tcl data consumer handler is specified, the default
Tcl data consumer handler ec_stream_output_popup handles and display the data on the Tcl side on a
pop-up window. The Tcl side
GUI has just one button which allows the application to terminate. This
button is disabled when ECLiPSe side has control, and this is done by
setting up the appropriate call-backs to disable and enable the button in
ec_running_set_commands on the Tcl side.
On disconnection, which can be initiated either by pressing the button on the Tcl side, or by quitting from ECLiPSe, the handlers for disconnection ensures that both the ECLiPSe and Tcl program terminates.