开发者

Invoking a CLIM UI from an application

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 co开发者_高级运维ntrol-flow outside of the CLIM top level is established and which simply interacts with the application-frame as needed?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜