10.38.4.8 Summary
The functions provided by the SICStus Prolog Tcl/Tk library can be grouped
in two ways: by function, and by package.
By function, we can group them like this:
- basic functions
tcl_new/1
- create a Tcl interpreter
tcl_delete/1
- remove a Tcl interpreter
tk_new/2
- create a Tcl interpreter with Tk extensions
- evaluation functions
tcl_eval/3
- evaluate a Tcl expression from Prolog
prolog
- evaluate a Prolog expression from Tcl
- Prolog event queue functions
tcl_event/3
- evaluate a Tcl expression and return a Prolog queue event list
tk_next_event/[2,3]
- pass control to Tk until a Prolog queue event happens and return
the head of the queue
prolog_event
- place a Prolog term on the Prolog event queue from Tcl
- servicing Tcl and Tk events
tk_do_one_event/[0,1]
- pass control to Tk until one Tk event is serviced
tk_next_event/[2,3]
- also services Tk events but returns when a Prolog
queue event happens and returns the head of the queue
- passing control completely to Tk
tk_main_loop/0
- control passed to Tk until all windows in all Tcl/Tk
interpreters are gone
- housekeeping
tk_main_window/2
- return reference to main in of a Tcl/Tk interpreter
tk_destroy_window/1
- destroy a window or widget
tk_make_window_exist/1
- force display of a window or widget
tk_num_main_windows/1
- return a count of the total number of Tk main windows
existing in the system
By package, we can group them like this:
- predicates for Prolog to interact with Tcl interpreters
tcl_new/1
- create a Tcl interpreter
tcl_delete/1
- remove a Tcl interpreter
tcl_eval/3
- evaluate a Tcl expression from Prolog
tcl_event/3
- evaluate a Tcl expression and return a Prolog event list
- predicates for Prolog to interact with Tcl interpreters with Tk
extensions
tk_new/2
- create a Tcl interpreter with Tk extensions
tk_do_one_event/[0,1]
- pass control to Tk until one Tk event is serviced
tk_next_event/[2,3]
- also services Tk events but returns when a Prolog
queue event happens and returns the head of the queue
tk_main_loop/0
- control passed to Tk until all windows in all Tcl/Tk
interpreters are gone
tk_main_window/2
- return reference to main in of a Tcl/Tk interpreter
tk_destroy_window/1
- destroy a window or widget
tk_make_window_exist/1
- force display of a window or widget
tk_num_main_windows/1
- return a count of the total number of Tk main windows
existing in the system
- commands for the Tcl interpreters to interact with the Prolog system
prolog
- evaluate a Prolog expression from Tcl
prolog_event
- place a Prolog term on the Prolog event queue from Tcl
In the next section we will discuss how to use the
tcltk
library to build graphical user interfaces to Prolog applications.
More specifically we will discuss the ways in which cooperation
between Prolog and Tcl/Tk can be arranged: how to achieve them,
and their benefits.
Send feedback on this subject.