Low level Interface between Prolog and blt

Author(s): Isabel Martín García.

This module exports some predicates to interact with Tcl-tk, particularly with the bltwish program. Bltwish is a windowing shell consisting of the Tcl command languaje, the Tk toolkit plus the additional commands that comes with the BLT library and a main program that reads commands. It creates a main window and then processes Tcl commands.


Usage and interface

Documentation on exports

PREDICATE
new_interp(Interp)

Creates a bltwish interprter and returns a socket. The socket allows the comunication between Prolog and Tcl-tk. Thus, bltwish receives the commands through the socket.

Usage:

  • The following properties should hold at call time:
    (term_typing:var/1)Interp is a free variable.
  • The following properties should hold upon exit:
    (bltclass:bltwish_interp/1)bltclass:bltwish_interp(Interp)

PREDICATE
tcltk_raw_code(Command_Line,Interp)

Sends a command line to the interpreter. Tcl-tk parses and executes it.

Usage:

  • The following properties should hold at call time:
    (basic_props:string/1)Command_Line is a string (a list of character codes).
    (bltclass:bltwish_interp/1)bltclass:bltwish_interp(Interp)

REGTYPE
bltwish_interp(Interp)

This type defines a bltwish interpreter. In fact, the bltwish interpreter receives the commands through the socket created.

bltwish_interp(Interp) :-
        stream(Interp).

PREDICATE
interp_file(File,Interp)

Sends the script file (File) to the interpreter through the socket. A script file is a file that contains commands that Tcl-tk can execute.

Usage:

  • The following properties should hold at call time:
    (streams_basic:sourcename/1)File is a source name.
    (bltclass:bltwish_interp/1)bltclass:bltwish_interp(Interp)