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

Manual: EVENT 4 1995


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

NAME

event -- to store information concerning events

SYNOPSIS


Events contain the information that handlers have to deal with. In other words, events encode the information resulting from invoking a script command, a user action (such as moving the mouse pointer) transmitted by the window environment, and several other kinds of events. The average user only has to deal with information coming from (Tcl) script commands or X window events. In a general way, events may be regarded to be the glue in hush and its extensions. See also the comments below.


slide: SYNOPSIS

INTERFACE


  interface event  {              
<hush/event.h>

<hush/event.idl>

sources/java/hush.dv.api.event

int argc() const;
no. of arguments

char** argv(int i=0) const;
the (Tcl) string arguments

char* arg(int i=0) const;
to fetch i th argument

char* args(int i) const;
string from i'th to last arg

int type() const;
X event type

int x(); int y(); int keycode(); };

slide: INTERFACE

DESCRIPTION


For the average user event objects represent the events generated by the X-window system of the embedded (Tcl) script language interpreter. Each event has a type, which may be one of the types listed below. The type of the event can be inspected with type() which returns an integer value or name() which returns a string representation of the type. For some of the common event types, such as ButtonPress, ButtonRelease, and MotionNotify, member functions are provided to facilitate testing. If an integer argument (1,2 or 3) is given to button(), buttonup() or buttonevent(), it is checked whether the event has occurred for the corresponding button. The functions x() and y() deliver the widget coordinates of the event, if appropriate. Calling trace for the event results in printing the type and coordinating information for the event. When setting the kit::trace level to 2 this information is automatically printed. Programmers not satisfied with this interface can check the type and access the underlying XEvent at their own risk.


slide: DESCRIPTION

SUBCLASSES


    tcl_event  -- from the binding of a handler to a Tcl command
    file_event -- from the binding of a handler to a file descriptor
    url_event  -- (under construction)
    tt_event   -- (under construction)
  
These special event classes are for advanced users only.
slide: SUBCLASSES

USAGE


Events are passed to the handler::dispatch function. To deal with the arguments of a (Tcl) callback or (for example) the arguments that result from invoking a menu or button handler one may use a line such as:

    int argc = _event->argc(); char** argv = _event->argv();
  
or alternatively
    string args = _event; 
see string(4)

Such calls typically occur in the operator() function of a handler object.

Advanced users may develop their own event classes, as well as their own handler callback functions.


slide: USAGE

COMMENTS


Actually the event class is a rather overloaded class, since it is shared by the hush widget classes and the simulation package sim. Don't bother with its complexity, from each perspective the event class offers exactly (?) what you need.


slide: COMMENTS

LIBRARY


hush -- file <hush/event.h>


slide: LIBRARY

SEE ALSO

handler(3), widget(3)

EVENT TYPES


KeyPress KeyRelease ButtonPress ButtonRelease MotionNotify EnterNotify LeaveNotify FocusIn FocusOut KeymapNotify Expose GraphicsExpose NoExpose VisibilityNotify CreateNotify DestroyNotify UnmapNotify MapNotify MapRequest ReparentNotify ConfigureNotify ConfigureRequest GravityNotify ResizeRequest CirculateNotify CirculateRequest PropertyNotify SelectionClear SelectionRequest SelectionNotify ColormapNotify ClientMessage MappingNotify LASTEvent

Consult your X (or Tcl/Tk) documentation for a full explanation of these (X) event types.


[.] Papers Tutorials Examples Manuals Interfaces Sources Packages Resources ?
Hush Online Technology
hush@cs.vu.nl
09/24/99