November 23rd, 2004

lambdagtk: a complete gtk2 binding for several lisp platforms

From Rick Taube:
I have a complete FFI to GTK2 for Darwin/OpenMCL, x86/CMUCL and x86/SBCL that I am releasing under the GNU copyleft agreement in the hopes that it may be of use to others in the Lisp community. A short overview, download links and installation instructions are at:

If you are interested in seeing what I'm using it for (including some pretty pics in the Examples section) go to:

Update Here's some simple Lisp Porn, generated by loading and running one of the examples. It's really just about this easy to set up and try:

Here's the source for (most of) scribble-simple:

(defun scribble-simple ()
  (let (window drawing-area vbox button)
    (setq window (gtk-window-new gtk-window-toplevel))
    (gtk-window-set-title window "Scribble Simple")
    (setq vbox (gtk-vbox-new nil 0))
    (gtk-container-add window vbox)
    (gtk-widget-show vbox)
    (setq drawing-area (gtk-drawing-area-new))
    (gtk-widget-set-size-request drawing-area 200 200)
    (gtk-box-pack-start vbox drawing-area t t 0)
    (gtk-widget-show drawing-area)
    (g-signal-connect drawing-area "expose_event"
                      (g-callback expose-event)
    (g-signal-connect drawing-area "configure_event"
                      (g-callback configure-event)
    (g-signal-connect drawing-area "motion_notify_event"
                      (g-callback motion-notify-event) (g-nullptr))
    (g-signal-connect drawing-area "button_press_event"
                      (g-callback button-press-event) (g-nullptr))
    (gtk-widget-set-events drawing-area
                           (logior gdk-exposure-mask
    (setq button (gtk-button-new-with-label "Quit"))
    (gtk-box-pack-start vbox button nil nil 0)
    (g-signal-connect-swapped button "clicked"
                              (g-callback destroy-event) window)
    (g-signal-connect window "destroy" (g-callback bye)
    (gtk-widget-show button)
    (gtk-widget-show window)

Cool stuff.

Update 2 After a minor patch suggested by Christophe:

(Yes, that's (code-char #x3BB) in the button label.)