\c{

The {\em session} class

Each program written with hush may contain only one embedded interpreter. To initialize the kit object wrapping the interpreter and to start the main event loop, an instance of the class session must be created. See slide class-session. The preferred way of doing this is by defining a descendant class of the session class, redefining the virtual function session::main to specify what needs to be done before starting the main loop. In addition, the constructor of the newly defined class may be used to check command line arguments and to initialize application specific data, as illustrated in slide hush-interpreter. } .so sli-session \c{ When creating a session object, the name of the application may be given as the last parameter. Under this name, the application is known to other Tk applications, which may communicate with each other by means of the send command. The function init may be used to specify a different initialization script. This script must include the default hush initialization script, which is an adapted version of the original wish initialization script. } \c{ Apart from the function main, a function prelude may also be defined. When the program is used as an interpreter (by giving {\tt -f file} as command line arguments) only the prelude function will be executed, otherwise prelude will be executed before main. In interpreter mode, the main function will also be executed when the script contains the command go-back. Finally, the function run must be called to actually initialize the program and start the main loop. }