Invoking a CLIM UI from an application

283 views Asked by At

In order to run a CLIM UI, the generic function clim:run-frame-top-level must be invoked, however this function blocks until the UI exits. This would seem to require all application control be handled via the CLIM top level.

Is it possible to structure an application differently such that a control-flow outside of the CLIM top level is established and which simply interacts with the application-frame as needed?

1

There are 1 answers

1
Rainer Joswig On BEST ANSWER

Most Common Lisp implementations that support CLIM have a way to run functions as a separate thread (usually called a PROCESS in Lisp).

In many Common Lisp implementations this function is called PROCESS-RUN-FUNCTION. See the documentation of your Lisp.

CLIM itself has a function MAKE-PROCESS. This is implementation independent and works on CLIM implementations on top of a multithreaded Lisp like Allegro CL, LispWorks, MCL, Genera, ...

Something like (example in the CLIM-USER package).

(make-process (lambda () (run-frame-top-level ...)))

should run the toplevel in its own thread.

This would allow you to run multiple frames, have other Lisp processes with REPLs, etc.