Author(s): Montse Iglesias Urraca.
Version: 1.8 (2002/5/16, 21:20:27 CEST)
Version of last change: 1.7#124 (2001/9/2, 14:14:25 CEST)
The
tcltk_low_level
library defines the low level interface used by the
tcltk
library. Essentially it includes all the code related directly to the handling of sockets and processes. This library should normally not be used directly by user programs, which use
tcltk
instead. On the other hand in some cases it may be useful to undertand how this library works in order to understand possible problems in programs that use the
tcltk
library.
tcltk_low_level
):- use_module(library(tcltk_low_level)).
tcltk_low_level
)
Usage: new_interp(-TclInterpreter)
-TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
Usage: new_interp(-TclInterpreter,+Options)
Options
.
-TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
+Options
is currently instantiated to an atom.
(term_typing:atom/1
)
Usage: new_interp_file(+FileName,-TclInterpreter)
FileName
. FileName
is treated as a name of a sript file
+FileName
is a string (a list of character codes).
(basic_props:string/1
)
-TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
Usage: tcltk(+Code,+TclInterpreter)
Code
converted to string to the TclInterpreter
+Code
is a Tcl command.
(tcltk_low_level:tclCommand/1
)
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
Usage: tcltk_raw_code(+String,+TclInterpreter)
Stream
to the TclInterpreter
+String
is a string (a list of character codes).
(basic_props:string/1
)
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
Usage: receive_result(-Result,+TclInterpreter)
Result
of the last TclCommand into the TclInterpreter
. If the TclCommand is not correct the wish process is terminated and a message appears showing the error
-Result
is a string (a list of character codes).
(basic_props:string/1
)
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
Usage: send_term(+String,+TclInterpreter)
TclInterpreter
. String
has the predicate with unified variables
+String
is a string (a list of character codes).
(basic_props:string/1
)
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
Usage: receive_event(-Event,+TclInterpreter)
Event
from the event socket of the TclInterpreter
.
-Event
is a list.
(basic_props:list/1
)
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
Usage: receive_list(-List,+TclInterpreter)
List
from the event socket of the TclInterpreter
.The List
has all the predicates that have been inserted from Tcl/Tk with the command prolog_event. It is a list of terms.
-List
is a list.
(basic_props:list/1
)
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
Usage: receive_confirm(-String,+TclInterpreter)
String
from the event socket of the TclInterpreter
when a term inserted into the event queue is managed.
-String
is a string (a list of character codes).
(basic_props:string/1
)
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
Usage: delete(+TclInterpreter)
TclInterpreter
from the system
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk_low_level:tclInterpreter/1
)
tcltk_low_level
)
Usage: core(+String)
core/1
is a set of facts which contain String
s to be sent to the Tcl/Tk interpreter on startup. They implement miscelaneous Tcl/Tk procedures which are used by the Tcl/Tk interface.
+String
is a string (a list of character codes).
(basic_props:string/1
)
tcltk_low_level
)
Two sockets are created to connect the TclInterpreter and the prolog process: the event_socket and the term_socket. There are two global variables: prolog_variables and terms. The value of any of the variables in the goal that is bound to a term will be stored in the array prolog_variables
with the variable name as index. The string which contains the printed representation of prolog terms is Terms. These are the Tcl/Tk procedures which implement the interface (the code is inside the
tcltk_low_level
library):
prolog
prolog_event
prolog_delete_event
prolog_list_events
prolog_cmd
prolog_one_event
prolog_thread_event
convert_variables
unify_term
Go to the first, previous, next, last section, table of contents.