next up previous index
Next: Index Up: ProTcXl 2.1 User Previous: Xlib Predicates

ProTcXl Commands

 
exit_prolog
This command exits Tk and the whole ECLiPSe session. It is equivalent to the original Tcl exit   command.

 

exit [code]
Exit Tcl/Tk and return back to Prolog. The optional code argument is ignored.

 

prolog pred [module]
Call the Prolog predicate pred in the module module using the Tcl syntax for the arguments. If module is omitted, eclipse   is assumed. Pred is a list whose first element is the Prolog predicate name and subsequent elements are its arguments. The arguments are converted to Prolog data as follows:

The return value of the prolog command is a string, one of success, fail or error. If the predicate call was successful and if it contained Prolog variables, the answer bindings of the variables can be retrieved from the global Tcl array var,   indexed by the variable name. Variables which are free when the command returns are not present in the var array.

 

call_prolog goal
Call a Prolog predicate using Prolog syntax. goal is a string which can be parsed as a Prolog goal. If it has the form Module:Pred,   then the goal Pred will be called in the module Module, otherwise goal will be called in the module eclipse. The command returns success, fail or error depending on the result of the Prolog predicate call. If the predicate succeeds, values of all variables occurring in the Prolog goal will be accessible in the global Tcl array var indexed by the variable name. Variables which are free when the command returns are not present in the var array. goal must not contain any spaces, because then it is passed to Prolog as a list and it tries then to call a predicate with wrong arity.

 

prolog_event arg [arg arg ...]
When called inside a Tk event handling procedure, the arguments of this command are converted to a Prolog list and saved as a Prolog graphics event which can be retrieved inside Prolog using the predicates tk_get_event/1   or tk_next_event/1  . The arguments are not converted to Prolog variables even if they have the right syntax. When Tk exits, either because the exit   command has been executed, or because its main window has been destroyed, an exit event is raised, which is equivalent to calling
prolog_event exit
The arguments are not flattened, it is not necessary to use the list command to keept the list format of an argument. If one of arg is string, the next argument is converted to Prolog as a string, no matter if its syntax corresponds to a Tcl list or not.



next up previous index
Next: Index Up: ProTcXl 2.1 User Previous: Xlib Predicates



Micha Meier
Tue Jul 2 09:49:39 MET DST 1996