EZ
Up Prev Next Contents


2.6.1 Prototypes for Callbacks and Event Handlers

Normal callbacks, motion callbacks and destroy callbacks have the following prototype:

void callback(EZ_Widget *widget, void *data)

where widget is the widget that callback is registered to. data is a pointer to a client data that will be passed to callback when invoked.

Input callbacks has the prototype

void inputcallback(EZ_Input *obj, void *data, int fd, int mask)

where obj is the EZ_Input to which callback is registered. data is an arbitary client data registered with callback. fd is a file descriptor. mask is or'ed from EZ_READABLE_MASK, EZ_WRITABLE_MASK and EZ_EXCEPTION_MASK.

Event handlers have the prototype

void eventHandler(EZ_Widget *widget, void *data,

int eType, XEvent *xevent)

where widget is the widget that eventHandler is registered to; data is a pointer to a client data that will be passed to the event handler; eType is the internal EZ event type; and xevent is the pointer to the actual X event, it contains all the information about the event. Normally, actions of your event handler should be based on xevent. However, if your event handler just wants to check whether a key has been pressed or the the state of a button, you may find that using eType is more convenient than deciphering xevent.


HTML Documentation Maintainance:Arturo Espinosa <arturo@nuclecu.unam.mx>