In this dialog there are text fields for entering a procedure and an event mask. The text fields have corresponding buttons which, when pressed, display sub-dialogs showing the procedures and event masks available. You may define a new procedure but the event masks should come from the valid set displayed. The event masks are annotated with the Java "coffee cup" if they are applicable to Java code
If the "Non Maskable" toggle is set, the event handler will also receive the non- maskable events (ClientMessage, GraphicsExpose, MappingNotify, NoExpose, SelectionClear, SelectionNotify and SelectionRequest). This toggle would normally remain unset as these events are not particularly useful to general applications.
The "Raw" toggle is a means of telling X-Designer to add a raw event handler. This is an event handler which does not respond immediately to the events for which it is registered. Instead, the handler is triggered when its events are selected elsewhere (by another event handler, for example).
One possible use of raw event handlers is to "shadow" another event handler. If both are added with the same event mask, but one is "raw" and the other is not, then both handlers will be called when the appropriate events occur. The raw event handler can then log the events that the other handler receives.
As with callback functions, you can specify the same event handler for any number of widgets and then use the Client Data to set the context.
Typically, event handlers are used in situations where the widget has little in the way of built-in interaction support, or where large volume or crude input may need processing. DrawingAreas are obvious candidates for event handlers.
Event handlers are generated by X-Designer into the code file as part of the general widget configuration and a stub is generated into the stubs file.
There is a "Widget annotation" for event handlers. By selecting the event handler annotation from the pullright menu in the View menu, you can see at a glance which widgets have had event handlers defined for them.
See also: