Hi Robert,

> Could you point me to that and tell me some more what you have ?

you can build http://logand.com/mplisp.tar.gz with Gtk FFI as follows:

- comment out everything except the lines containing gtk in the src/mod.h
  and src/mod.fn files

- change Makefile; remove unused stuff from "picoFiles = ...", CFLAGS,

- make

Then you have picolisp with src/mod/gtk.ffi.c wrapper.

The src/mod/gtk.ffi.c file should be usable even with the full-blown
32 bit picolisp.  I have not tried it, but you would need to:

- build a DLL or use the picolisp's gcc function (and figure out how
  to pass "CFLAGS" and "LDFLAGS" to it?)

- change function names; otherwise cfun_gtk_window_new would become
  gtk:cfun_gtk_window_new which is ugly

The file src/mod/gtk.ffi.c is just a generated FFI wrapper to existing
Gtk functions.  I have not implemented callbacks yet as there need to
be some non-trivial code written to pass around user_data.  You can
get the idea either from gtk-server or CLisp Gtk module:

   ;;; callback handling

   ;; this is complicated as each callback can have a different number
   ;; of arguments and it is the last that is most interesting (a
   ;; gpointer to some data we manage)

> I am a heavy gtk programmer and really interested in this approach.

There is also another approach which might be a bit limited in some
ways but is much simpler: using gtk-server. Have a look at the
examples at


You need to install gtk-server and change the line

(setq *GtkServer (pack (sys 'HOME) "/sw/gtk-server-2.2.4/gtk-server"))

in gtk.l to your real path.



Reply via email to