Next: , Previous: , Up: Event Dispatching with SERVE-EVENT   [Contents][Index]

7.4 Using SERVE-EVENT with the CLX Interface to X

Remember from section object-sets, an object set is a collection of objects, CLX windows in this case, with some set of operations, event keywords, with corresponding implementations, the same handler functions. Since X allows multiple display connections from a given process, you can avoid using object sets if every window in an application or display connection behaves the same. If a particular X application on a single display connection has windows that want to handle certain events differently, then using object sets is a convenient way to organize this since you need some way to map the window/event combination to the appropriate functionality.

The following is a discussion of functions exported from the extensions package that facilitate handling CLX events through system:serve-event. The first two routines are useful regardless of whether you use system:serve-event:

Function: ext:open-clx-display &optional string

This function parses string for an X display specification including display and screen numbers. String defaults to the following:

    (cdr (assoc :display ext:*environment-list* :test #'eq))

If any field in the display specification is missing, this signals an error. ext:open-clx-display returns the CLX display and screen.

Function: ext:flush-display-events display

This function flushes all the events in display’s event queue including the current event, in case the user calls this from within an event handler.

Next: , Previous: , Up: Event Dispatching with SERVE-EVENT   [Contents][Index]