http://www.w3.org/TR/html4/loose.dtd">
|
StdGUI CALLBACK Functions |
|
#define CALLBACK(NAME,EVT,ARG) int NAME(EVENT *EVT, char *ARG) CALLBACK(cb_func, p_evt, p_str){...} CALLBACK((*cb_ptr), evt, str); int define_callback(char *p_name, CALLBACK((*p_cb),evt,arg)); int define_callbacks(char *p_name, CALLBACK((*p_cb),evt,arg), ...); |
|
Callback functions are used to associate client code with framework events. All callback functions return an integer and take two parameters: an event structure and a generic string parameter. The framework provides a macro that can be used to define callback functions and callback function pointer variables. The macro takes three parameters: the function or variable name (NAME), the event parameter (EVT) and the string parameter (ARG). The define_callback() function is used to give string names (p_name) to callback routines (p_cb). The define_callbacks() function is a multi-parameter version of define_callback(). The list of parameters is terminated by a NULL value for the final p_name parameter. |
|
On success, a callback function should return zero (0). If the callback function experiences a problem (failure or error) or if the function can’t fully process the event it is given, it should return a non-zero value. Currently, any non-zero value will be taken as an indication that the event was not fully processed and should be passed up the event handling hierarchy (widget to window to context). At some point, however, there may be different interpretation of negative and positive non-zero values. The define_callback() and define_callbacks() functions return zero (0) on success, non-zero on failure. |
|
Jeffrey Dutky |