I'm porting CLG-0.51 over to LispWorks 4.2 on Windows. This is
based on glib-1.3.12-20020101.zip and gtk+-1.3.0-20020207.zip
available at http://www.gimp.org/win32. The porting is almost
finished and my system (http://chi-square-works.com) can run on
a Windows machine without major problems now. There is one last
hurdle I'd like to overcome before I release the CLG-0.51 port
for LispWorks 4.2 on Windows (a couple of questions about
releasing later): How to duplicate in LispWorks the behaviour of:
(system:add-fd-handler (gdk:connection-fd) :input #'gtk:main-iterate-all)
in gforeing:init. It is this line of code that gives us the freedom
to do things in Lisp listener (for example poking around in a bunch of
GTK widgets) while a GTK program is running. LispWorks 4.2 on Windows
doesn't have any functionality similar to CMUCL's system:add-fd-handler.
Right now I have to do (gtk:main) explicitly so that my system can
start taking user input and doing its business. But calling (gtk:main)
prevents me from using the Lisp listener and I miss the lispy interaction
I have in CMUCL/CLG. I've tried the following approach without much
(mp:process-run-function "testing gtk main iterate all"
(declare (ignore x))
The system would run awhile but eventually it goes belly up with an
error message like "Processor Fault #xC0000005 at #x780143C7", which
is typical for things messed up during foreign function calls in
LispWorks. The stack at this time also indicates something wrong with
the foreign function call to "gtk_main_iteration_do". Besides, all
menus behaves weirdly. For example, the menu from a menu bar won't stay
up most of the times if I just click the associated menu bar item. If
I press and hold the mouse button, the menu will stay up but my cursor
disappears. After I poked around a bit and found out
(gtk:main-iterate-all) was still merrily running around every 0.2 second
while I pressed and held down the mouse button on a menu bar item.
I suspect some events are garbled up by these (gtk:main-iterate-all)
calls every 0.2 second. Could somebody who knows the inner workings
of GTK main loops suggest some workarounds?
About releasing the CLG-0.51 port for LispWorks 4.2 on Windows, where
should I send the code? I also added lots of define-foreign's to CLG-0.51
for CMUCL/Linux so that I could do statistical graphics. Where should
I send this extra code?
Thanks to anybody who reads up to this point.