next up previous contents index
Next: Writing Ltk extensions Up: Under the hood Previous: Under the hood   Contents   Index

Communication

At the startup of the wish process, some tcl helper functions are defined and then the functions in the list *INIT-WISH-HOOK*. These purpose of these functions is to perform initialisations, e.g. loading Tk extensions.

All communication from Tk to Lisp takes place in form of lists, which are read-able. The first element of the list is a keyword, which determines what kind of information is following. :data is the answer to a call to a function like reading out the content of a widget. :callback is sent upon a callback event and :event for an event created by the bind function. This design is neccessary, because events can be generated (and thus messages to Lisp sent), while Lisp is waiting for a data answer. So the function read-data can buffer those events until the requested data arrives. Only after the data request has been fufilled, all pending events are processed.



Peter Herth 2006-01-29