Lisp REP - GTK



  • 1. Question about let & repeated expressions
    As I'm learning CL, I've gotten into the habit of always introducing a local variable when I see an expression used multiple times. Is this necessary, or should I assume the compiler will notice the repeated expression and compute it only once? Neil
  • 2. OT: creating Grand Central Dispatch objects at runtime.
    Sort of lisp related, does anyone know libdispatch well enough to say how hard it would be to create a block at runtime (say from a lisp runtime with using its ffi)?

Lisp REP - GTK

Postby Werner Block » Thu, 05 Feb 2004 09:11:18 GMT

Interrest ?

Look they here 

Werner Block 

Re: Lisp REP - GTK

Postby bruno » Tue, 10 Feb 2004 00:05:07 GMT

librep with its GTK bindings can lead to a nice interactive GUI
development system. However, it's hard to get there if

- No tutorial explains how to set up librep with the GTK bindings.
  Assume I have Gnome already installed, on Linux, and I've got the sources
  of librep. What other packages do I need to install, in which order?

- The tutorial is in German. I can read German, but for most people
  English is better.

- The tutorial doesn't contain a link to reference documentation that
  would explain all functions, from gtk-window-set-default-size to


Similar Threads:

1.I need documentation over REP GTK!

I need documentation over REP GTK! Can someone help me further?

Werner Block

2.common lisp gtk bindings

I know that there are some packages available. I just wonder what are
the most stable? And which one has bindings to LispWorks and SBCL?


Please remove just-for-news- to reply via e-mail.

3.clg (GTK for Common Lisp) and CMUCL 19a

I'm having troubles getting clg-0.51 running on CMUCL 19a. One problem
is package locking (wich can be turned off by evaluating unlock-all-packages),
but another problem is pathnames in the new version of CMUCL (19a) versus
the earlier ones. I have found links about other problems with this (mathlisp)
but the reason (or soulution) have not been properly described.

I would be happy if anyone with the proper knowledge of the load funciton
and "portable" pathnames in CMUCL would look into it.

Example session when compiling for CMUCL 19a (make cmucl in source dir):

|; Loading #p"/usr/home/oyvin/programmering/lisp/clg/tools/build.lisp".
|Error in batch processing:
|Error in function LISP::SUBSTITUTE-INTO:
|   Not enough wildcards in FROM pattern to match TO pattern:
|*** Error code 1
|Stop in /usr/home/oyvin/programmering/lisp/clg/cmucl.
|*** Error code 1
|Stop in /usr/home/oyvin/programmering/lisp/clg.
|vequess:% head -n 2 tools/build.lisp
|(load "cl-gtk:tools;gendefpackage.lisp")
|(load "cl-gtk:tools;buildtools.lisp")

clg is available from sourceforge and linked to from cliki as well


4.[ANNC] new foster home:

5.Gtk-Server and Lisps, was (Sockets with SBCL)

On Thu, 09 Jun 2005 17:00:19 +0200, Philippe Lorin wrote:

> I'm trying to use GTK-server with SBCL.

That's how I've done it, using stdin method.

;;;; -*- Mode: Lisp; Syntax: ANSI-COMMON-LISP; -*-
;;;; gtk-server.lisp

(in-package :gtk-server)

(defparameter +gtk-server+ "gtk-server")
(defparameter +gtk-server-stdin+ (list "stdin"))

(defparameter *gtk-server* nil
  "The gtk-server process.")
(defparameter *gtk-pipe* nil
  "Stream used to communicate with gtk-server.")
(defparameter *gtk-init-done* nil)

(defparameter *gtk-server-log* t
  "If this value is set to t the gtk-server will write a log
to #+linux \"/tmp/gtk-server.log\".")

(defun gtk-server-args ()
  (if *gtk-server-log*
      (append +gtk-server-stdin+ (list "log"))

#+(or cmu sbcl)
(defun start-gtk-server ()
  "Starts an gtk-server, unless we have one that is running already."
  (unless (and (process-p *gtk-server*)
               (eq (process-status *gtk-server*) :running))
    (setf *gtk-server*
          (run-program +gtk-server+ (gtk-server-args)
                       ;; by default SBCL does not search in path.
                       #+sbcl :search #+sbcl t
                       :wait nil
                       :input :stream
                       :output :stream))
    (setf *gtk-pipe*
          (make-two-way-stream (process-output *gtk-server*)

                               (process-input *gtk-server*)))))

(defun start-gtk-server ()
  (unless (streamp *gtk-pipe*)
    (setf *gtk-pipe*
          (ext:run-program "gtk-server"
                           :arguments (gtk-server-args)
                           :input :stream
                           :output :stream
                           :wait t))))

(defun start-gtk-server ()
  (unless (streamp *gtk-pipe*)
    (setf *gtk-pipe*
          (ext:run-program "gtk-server"
                           :input :stream
                           :output :stream
                           :error :output))))

(defun gtk-server-send (string)
  "Send a command to be executed to gtk-server, get the response.
This is either a widget/event id, a ``boolean'' (0/1), or just ok.
Always as a string."
  (write-string string *gtk-pipe*)
  (force-output *gtk-pipe*)
  (read-line *gtk-pipe*))

(defun ask-gtk (fname &rest args)
  "Send a command to be executed to gtk-server, and get the response."
  (write-string fname *gtk-pipe*)
  (dolist (arg args)
    (write-char #\Space *gtk-pipe*)
    (typecase arg
      (string (write arg :stream *gtk-pipe* :escape t))
      (t (write arg :stream *gtk-pipe* :escape nil))))
  (force-output *gtk-pipe*)
  (read-line *gtk-pipe*))

(defun gtk-init ()
  "Not that is really necessary, Just Handy(TM)."
  (gtk-server-send "gtk_init NULL NULL"))

(defun get-event (&key wait)
    (ask-gtk "gtk_server_callback" (if wait "wait" "update")))

(defun ensure-gtk-server ()
  (unless *gtk-init-done*
    (setf *gtk-init-done* t)))

(defun stop-gtk-server ()
  ;; Just write, Do not wait for response.
  (write-string "gtk_exit 0" *gtk-pipe*)
  (force-output *gtk-pipe*)
  (close *gtk-pipe*)
  (setf *gtk-init-done* nil)
  #+(or cmu sbcl)
  (process-wait *gtk-server*))

;; with-gtk-server -- takes care of starting the server and shutting it
(defmacro with-gtk-server (&body body)
    (assert *gtk-pipe*);;

6. Cells-gtk [was]: Lisp GUI toolkits

7. Lisp GUI How-to [was cells-gtk screen shots]

8. Lisp + SDL + GTK

Return to lisp


Who is online

Users browsing this forum: No registered users and 2 guest