Messages
 

When a user interface element (window, control, menu) is created, a special predicate must be defined to handle incoming messages.

The first argument of such a predicate is a message name. Presently this can be one of the following:
 
init sent upon creation
close tries to close the windowIf the window predicate processing this message fails then the window will be closed, otherwise it will not be closed (example SUN)..
mouse_click (X,Y) (left button) mouse clicked at coordinates X, Y inside the client area
r_mouse_click (X,Y) (right button) mouse clicked at coordinates X, Y inside the client area
size (X,Y) the window changed its size and the new size of its client area is X, Y.
press button or menu item was pressed
paint the window must be redrawn

Note: if you do not want to process the messages to some given window, a predicate with no clauses for it should be declared as the window's function (e.g. fail(X)).

See also:

window