I implemented SLIME REPL integration for CommonQt some time ago, don't know whether it still works in recent CommonQt/SLIME versions, see https://github.com/commonqt/commonqt/blob/master/repl-integration.lisp It utilizes SLIME REPL eval hooks to make SLIME REPL evaluate expressions in the context of GUI thread, which is much safer than just starting separate thread and hoping that doing stuff in the main thread will not cause some kind of race condition. When it worked it was enough to do (ql:quickload 'qt-repl) (qt-repl:start-gui-thread) And after that you could do most GUI stuff right from REPL without worrying that something will break. In my not-up-to-date CommonQt fork it still works, at least when using CCL: https://github.com/ivan4th/commonqt
On Tue, Dec 29, 2015 at 1:11 AM, Stas Boukarev stassats@gmail.com wrote:
On Tue, Dec 29, 2015 at 1:08 AM, Orm Finnendahl orm.finnendahl@selma.hfmdk-frankfurt.de wrote:
Am Dienstag, den 29. Dezember 2015 um 00:54:09 Uhr (+0300) schrieb Stas
Boukarev:
All the GUI stuff has to be done from the same thread (and on some OSes it has to be the main thread). To communicate with Qt from a different thread use Qt signals, they are thread-safe.
Thanks, that helps! Do you know, why it is impossible to restart the tutorial example after the thread has finished? Restarting in the main thread after closing the window is no problem. The only way to restart the tutorial after running it within sb-threads:make-thread is to restart sbcl.
You can restart it in that thread, but only in that thread. The event loop cannot be restarted, but as long as it's running you can execute and close as many windows as you'd like.
-- With best regards, Stas.