The DejaVU Framework -- hush 3.1
[.] Papers Tutorials Examples Manuals Interfaces Sources Packages Resources ?

Manual: KIT 4 1995


[.] [man] man1 man2 man3 man4 man5 man6 man7 man8 man9 manl mann ?

NAME

kit -- provides access to the underlying system

SYNOPSIS


For the average user, the kit is an intermediary between the C++ code and the embedded Tcl interpreter. Do not, if not strictly needed, bypass the kit. It may cause problems, now and in the future. More abstractly, the kit provides access to an underlying system with state. Typically, the state is defined by the binding of elements of a script language and the values of (state) variables.


slide: SYNOPSIS

INTERFACE


  
  interface kit {                         
<hush/kit.h>

<hush/kit.idl>

sources/java/hush.dv.api.kit

enum { tcl = 0, python, dlp , nop };
kit modalities

kit(int mode=kit::tcl);
the default tickle kit

kit(void*);
system level constructor

int eval(char* cmd);
to evaluate script command

char* result();
to fetch the result of eval

void result(char* s);
to set the result of eval

char* evaluate(char* cmd);
combines eval and result

int source(char* s);
to load a script

binding* bind(char* cmd, handler* h);
to bind command to handler

binding* bind(int fd, handler* h, int mask = readable); // for filedesc. void unbind(char* cmd);
to unbind a command

void unbind(int fd);
to unbind a filedescriptor

char* selection(char* options);
X environment

void after(int msecs, char* cmd = ""); void after(int msecs, handler* h); void update(char* options* = "");
to update display

char* send(char* it, char* cmd); widget* root();
returns toplevel (root) widget

widget* pack(widget* w, char* options = ""); widget* pack(char* wp, char* options = ""); void trace(int level = 1); void notrace(); void quit(); // Advanced -- dependent (safe) kits kit* slave(char* options="");
options: -safe -tk

int safe();
to determine safety

// System-level -- for installing widget bindings binding* bind(handler*, char* args = "");
anonymous handlers

binding* bind(char* name, void* h, void* c = 0);
very low level!

void command(char* name, void*, void* = 0); void command(ing fd, int mask, void*, void* = 0); // Experimental -- do not use it kit* become(char* s, kit* k = 0);
role-switch, see issues(4)

void restore(kit* k = 0);
0 -> default kit

};

slide: INTERFACE

DESCRIPTION


For the ordinary user, a kit object provides an interface to the Tcl interpreter and other global properties of the system. The first group of functions (eval, result, evaluate and source) may be used to execute commands in Tcl scripting language directly. A Tcl command is simply a string conforming to certain syntactic requirements. The function eval evaluates a Tcl command. The function result() may be used to fetch the result of the last Tcl command. In contrast, the function result(char*) may be used to set the result of a Tcl command, when this command is defined in C++ (as may be done with kit::bind). The function evaluate provides a shorthand for combining eval and result(). The function source may be used to read in a file containing a Tcl script. The function bind may be used to associate a Tcl command to a command function or handler written in C++. The function selection gives access to the X selection. The function after may be used to have a Tcl command evaluated after n milliseconds. (It makes use of X timer callbacks). The function send may be used to evaluate a command in a different application. An application may be given a name when creating the session object. These functions are only for experienced users. The function root gives access to the toplevel widget associated with that particular instance of the kit. The function pack may be used to append widgets to the root widget, in order to map them to the screen. Widgets may be identified either by a pointer to a widget object or by their pathname, which is a string. See widget(4). The functions trace() and notrace() may be used to turn on, respectively off, tracing. The level indicates in what detail information will be given. Trace level zero is equivalent to notrace(). Finally, the function quit may be used to terminate the execution.


slide: DESCRIPTION

SUBCLASSES


     tcl_kit -- implements Tcl language binding
     python_kit -- experimental
  
These kits are not exported. However, they are initialized by choosing the corresponding mode.
slide: SUBCLASSES

USAGE


Only advanced users and system-level programmers will have te create kits explicitly. The tk instance variable of handler objects and the session object gives immediate access to the kit.


slide: USAGE

LIBRARY


hush -- file <hush/kit.h>


slide: LIBRARY

SEE ALSO

session(4), handler(4), event(4), widget(4), item(4)
[.] Papers Tutorials Examples Manuals Interfaces Sources Packages Resources ?
Hush Online Technology
hush@cs.vu.nl
09/24/99