Hi, again!
I saved a CLISP image with ASDF, CFFI, and some more packages in it...
Then I associated *.lisp files with this image and now I have small
"script" interpreter (so I can write small single-file programs without
all the burden of loading often used packages... (isn't Lisp cool ?!)
(Some weeks ago I tried to save an image with "qt.lisp" loaded. I saved
it successfully, but at runtime it broke miserably... So I still need to
load "qt.lisp" in the code)
The real issue I wanted to concern is this annoying console window.
CLISP is console application, and also are the executable (:executable
t) images it saves. So doble-clicking on a *.lisp file my image first
shows a console window and then the QT application window, over it.
(I've read somewhere that the ECL guys had already addressed that issue
and the Windows version is able to build "windows" subsystem standalone
applications, for which the win32 loader doesn't create a console). As
still there is not (at least I couldn't find) a corresponding CLISP
solution - I approached it in a FFI way, first trying CFFI, which turned
out does not support the STDCALL calling convention :(( So I fell
through to CLISP's FFI:
> (require :qt "qt")
>
> (defpackage :qt-tree (:use :cl :qt))
> (in-package :qt)
>
> #+win32
> (progn
> #+cffi-supports-stdcall ; I'm looking forward this ;))
> (progn
> (cffi:load-foreign-library "kernel32")
> (cffi:defcfun ("FreeConsole" win32-free-console) :int)
> (win32-free-console))
>
> #+clisp
> (progn
> (ffi:def-call-out win32-free-console (:return-type ffi:int)
> (:library "kernel32") (:name "FreeConsole") (:language
> :stdc-stdcall)
> (:documentation "Frees/hides the process' console of a
> console process."))
> (win32-free-console)))
>
> (with-qt ()
> ....
Fortunately this works - the console window disappears shortly after the
program is run and only the main window remains, working :)))
Unfortunately only till the main window is closed - then I get a "Don't
send" error message...
Any ideas?
Rado
|