DESIGN (xvwidgets) functions


LIBRARY ROUTINE

xvw_add_event - add an event handler to an object

LIBRARY CALL

void xvw_add_event(
   xvobject      object,
   unsigned long event_mask,
   void          (*routine)(xvobject, kaddr, XEvent *, int *),
   kaddr         client_data)

INPUT

OUTPUT

none

RETURN VALUE

none

DESCRIPTION

Add an event handler to a visual object. When the specified event(s) occur, the event handler will be called.

Since the X Toolkit cannot support event handling of gadgets, we support them by placing the event handler on the parent and then directing the dispatch of the event handler directly.

The event handler must be associated with an object; only when the specified event(s) occur on the specified object will the event handler be called (ie, the same event in another object will be ignored).

An event handler must be declared in the following form: void event_handler( xvobject object, kaddr client_data, XEvent *event, int *dispatch)

object - The object for which the event handler was invoked. It will not be NULL.

client_data - The pointer to the client data, used to pass parameters from the application to the event handler.

event - This is a pointer to the XEvent union which caused the event handler to be invoked. For details on the XEvent union, see Chapter 8 of the Xlib Programming Manual, by Adrian Nye; the definition of the XEvent union is on page 232.

dispatch - By default, the event that caused this event handler to be invoked will continue to propagate to any other event handlers that might also be installed for the same event on the same visual object. The dispatch integer pointer can be used to prevent the event from being dispatched, and to prevent any other such event handlers from being called. To prevent dispatch of the event to any other event handlers, set this variable to FALSE, as in: *dispatch = FALSE;

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$DESIGN/objects/library/xvwidgets/src/event.c

SEE ALSO

xvwidgets(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.