IP_SetGUIHandler

IP_SetGUIHandler — sets callback functions for GUI events.

Syntax

#include <cogent.h>
int IP_SetGUIHandler(IP_pfGUIFilter  filter,
 IP_pfGUIHandler  handler);

Arguments

filter

A GUI filter function.

handler

A GUI event handler function.

Returns

0

Description

This function sets the two callback functions required to deal with a GUI event through IP_Receive. These functions must match the following types:

typedef int (*IP_pfGUIFilter)(int rcvid, void* msg, int length);
typedef int (*IP_pfGUIHandler)(void* msg, int length);

The filter function returns 0 if the rcvid, msg and length do not represent a GUI message for this GUI, and returns non-zero if the given message is a GUI message.

The handler function must be able to process any message for which the filter function returns non-zero, routing the message to the appropriate GUI facility.

If the filter function returns non-zero, then the IP library functions will perform no further processing on that message, but will return from IP_Receive with a message type of IP_GUI. The programmer is not required to provide code for a message of type IP_GUI.

See Also

Receiving Messages and Events, IP_Receive