[gambit-list] Graphical environment

Marc Feeley feeley at iro.umontreal.ca
Fri Sep 2 20:32:23 EDT 2005


On 2-Sep-05, at 5:41 PM, Marc Feeley wrote:

> Well... the source code to GUIDE (Gambit Universal IDE) is  
> distributed with Gambit.  The code works but I haven't had the time  
> to automate the build process (i.e. the makefile is broken).  If  
> your student, or some makefile expert would like to help out that  
> would be great.
>
> Of course, there is always the emacs interface, which is the  
> development environment I use most (it support single stepping,  
> source code pinpointing when there is an error, etc).  Surely you  
> can force your student to use emacs!
>
> Marc
>

Oh, and there are two other options... you can wait for the "web  
browser IDE" that Guillaume Germain is writing as an example of  
Termite for his master's thesis.

Second option is to roll your own using your favorite GUI framework.   
It's not too hard to control Tk from Gambit using open-process.   
Here's a small example.  A reasonably complete interface to Tk should  
not take more than a few days to write.

(define tk (open-process "wish"))

(define (tk-send . lst) (display lst tk) (newline tk) (force-output tk))

(define (button name label action)
   (tk-send "button " name " -text " label " -command " (export action))
   name)

(define (pack . lst) (tk-send "pack" (map (lambda (x) (list " " x))  
lst)))

(define make-tag (let ((n 0)) (lambda () (set! n (+ n 1)) n)))

(define (export proc) (list "{puts (" (register (make-tag) proc) ")}"))

(define (register tag proc) (table-set! registry tag proc) tag)

(define registry (make-table))

(define b1 (button '.b1 "hello" (lambda () (pp 'hello-clicked))))
(define b2 (button '.b2 "world" (lambda () (pp 'world-clicked))))
(pack b1 b2)

(let loop () ; event loop
   (let ((cmd (read tk)))
     (if (list? cmd)
         (begin
           (apply (table-ref registry (car cmd)) (cdr cmd))
           (loop)))))

Marc




More information about the Gambit-list mailing list