Go to the first, previous, next, last section, table of contents.
Author(s): Montse Iglesias.
Version: 1.5#171 (2000/7/7, 16:10:17 CEST)
Version of last change: 1.5#16 (1999/12/14, 17:12:49 MET)
The
tcltk
library package is a bidirectional interface to the Tcl (pronounced Tickle) language and Tk toolkit. Tcl is an interpreter scripting language with many extensions packages, in particular the graphical interface toolkit Tk
- Library usage:
:- use_module(library(tcltk)).
- Exports:
- Predicates:
tcl_new/1
,
tcl_eval/3
,
tcl_delete/1
,
tcl_event/3
,
tk_event_loop/1
,
tk_loop/1
,
tk_new/2
,
tk_new/4
,
tk_next_event/2
.
- Regular Types:
tclInterpreter/1
,
tclCommand/1
.
- Other modules used:
- System library modules:
tcltk/tcltk_low_level
,
write
,
strings
,
lists
.
- REGTYPE: tclInterpreter/1:
-
To use Tcl, you must create a Tcl interpreter object and send commands to it.
Usage: tclInterpreter(I)
- Description:
I
is a reference to a Tcl interpreter.
- REGTYPE: tclCommand/1:
-
A Tcl command is specified as follows:
Command --> Atom { other than [] }
| Number
| chars(PrologString)
| write(Term)
| format(Fmt,Args)
| dq(Command)
| br(Command)
| sqb(Command)
| min(Command)
| ListOfCommands
ListOfCommands --> []
|[Command|ListOfCommands]
where:
- Atom
-
- Number
-
denote their printed representations.
- chars(PrologString)
-
denotes the string represented by PrologString (a list of character codes).
- write(Term)
-
denotes the string that is printed by the corresponding built-in pridicate.
- format(Term)
-
denotes the string that is printed by the corresponding built-in pridicate.
- dq(Command)
-
denotes the string specified by Command, enclosed in double quotes.
- br(Command)
-
denotes the string specified by Command, enclosed in braces.
- sqb(Command)
-
denotes the string specified by Command, enclosed in square brackets.
- min(Command)
-
denotes the string specified by Command, immediately preceded by a hyphen.
- ListOfCommands
-
denotes the strings denoted by each element, separated by spaces.
Usage: tclCommand(C)
- Description:
C
is a Tcl command.
- PREDICATE: tcl_new/1:
-
Usage: tcl_new(-TclInterpreter)
- Description: Creates a new interpreter, initializes it, and returns a reference to it in
TclInterpreter
.
- Call and exit should be compatible with:
-TclInterpreter
is a reference to a Tcl interpreter.
(tcltk:tclInterpreter/1
)
- PREDICATE: tcl_eval/3:
-
Usage: tcl_eval(+TclInterpreter,+Command,-Result)
- Description: Evaluates the commands given. The result will be stored as a string in Result. If there is an error in the Command, an exception is raised. The error messages will be Tcl Exception: , if the error is in the syntax of the tcltk code or Prolog Exception: , if the error is in the prolog term.
- Call and exit should be compatible with:
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk:tclInterpreter/1
)
+Command
is a Tcl command.
(tcltk:tclCommand/1
)
-Result
is a string (a list of character codes).
(basic_props:string/1
)
- PREDICATE: tcl_delete/1:
-
Usage: tcl_delete(+TclInterpreter)
- Description: Deletes the interpreter in
TclInterpreter
and the memory used by it
- Call and exit should be compatible with:
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk:tclInterpreter/1
)
- PREDICATE: tcl_event/3:
-
Usage: tcl_event(+TclInterpreter,+Command,-Events)
- Description: Lets TclInterpreter interpret the command specified by Command. Events is a list of terms stored from Tcl by the prolog_event.
- Call and exit should be compatible with:
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk:tclInterpreter/1
)
+Command
is a Tcl command.
(tcltk:tclCommand/1
)
-Events
is a list.
(basic_props:list/1
)
- PREDICATE: tk_event_loop/1:
-
Usage: tk_event_loop(+TclInterpreter)
- Description: Waits an event and execute the term associated to it. Sends the unified term to obtain the value of the tcl array of prolog_variables.
- Call and exit should be compatible with:
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk:tclInterpreter/1
)
- PREDICATE: tk_loop/1:
-
Usage: tk_loop(+TclInterpreter)
- Description: Passes control to Tk until all windows are gone.
- Call and exit should be compatible with:
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk:tclInterpreter/1
)
- PREDICATE: tk_new/2:
-
Usage: tk_new(+Options,-TclInterpreter)
- Description: Performs basic Tcl and Tk initialization and creates the main window of a Tk application.Options is a list of optional elements according to :
- name
-
Sets the Tk application name. The application name will be displayed in the main window and is also used for communicating between applications in Tk. Default name is an empty string.
- display
-
Gives the name of the screen on which to create the main window. Default is normally determined by the DISPLAY environment variable.
- file
-
Open the sript file, commands will not be read from standard input and the execution returns back to Prolog only after all windows (and the interpreter) have been deleted.
- Call and exit should be compatible with:
+Options
is a list.
(basic_props:list/1
)
-TclInterpreter
is a reference to a Tcl interpreter.
(tcltk:tclInterpreter/1
)
- PREDICATE: tk_new/4:
-
No further documentation available for this predicate.
- PREDICATE: tk_next_event/2:
-
Usage: tk_next_event(+TclInterpreter,-Event)
- Description: Processes events until there is at least one Prolog event associated with TclInterpreter. Event is the term correspondig to the head of a queue of events stored from Tcl with the prolog_event command.
- Call and exit should be compatible with:
+TclInterpreter
is a reference to a Tcl interpreter.
(tcltk:tclInterpreter/1
)
-Event
is a string (a list of character codes).
(basic_props:string/1
)
Go to the first, previous, next, last section, table of contents.