Next: , Previous:  


7 Event handlers

X events are also represented as structured objects with slot names which are directly translated from the C equivalent. The accessor functions are named by <event name>-<slot name>. Some examples:

(event-window event)

This applies to all events

(event-type event)

So does this

(button-event-x event)

Some button event

(button-event-button event)

accessors

At the moment, XClientMessage and XKeyMap events are not supported (they will be in the not too distant future).

Provided conveniences

Since Motif requires the use of font lists for building non-trivial compound strings, there are some Lisp functions to ease the pain of building them:

Function: build-simple-font-list name font-spec

Returns a font list of with the given name associated with the given font. For example,

(build-simple-font-list "MyFont" "8x13")
Function: build-font-list flist-spec

This allows for the construction of font lists with more than one font. An example:

(build-font-list `(("EntryFont" ,entry-font-name)
                   ("HeaderFont" ,header-font-name)
                   ("ItalicFont" ,italic-font-name)))

There are certain callbacks which are of general use, and standard ones are provided for the programmer’s convenience. For all callbacks except QUIT-APPLICATION-CALLBACK, you register some number of widgets with ADD-CALLBACK. These will be the widgets acted upon by the callback:

Function: quit-application-callback

Callback to terminate the current application.

Function: destroy-callback

Destroys all the widgets passed to it.

Function: manage-callabck

Manages all the widgets passed to it.

Function: unmanage-callback

Unmanages all the widgets passed to it.

Function: popup-callback

Calls popup on all widgets passed to it.

Function: popdown-callback

Calls popdown on all widgets passed to it.


Next: Some random notes, Previous: Action procedures