This is the mail archive of the kawa@sourceware.cygnus.com mailing list for the Kawa project. See the Kawa home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: proposal for Kawa event call-back



Hi Per,

I needed the possibility to create small interfaces with buttons 
and sliders for quick prototyping. I took a very naive approach:
SchemeActionListener subclasses java.awt.event.ActionListener. On 
events, it evaluates the Kawa Procedure given as argument to its
constructor. It looks something like this: 

(define (new-action-listener proc)
  ((primitive-constructor "something.SchemeActionListener" 
                          ("kawa.lang.Procedure1")) 
     proc))

(define (make-frame title width height)  ... )
(define (add-button container x y width height label proc) ... )
(define (button-proc evt) (display "gotcha!\r"))
(define frame (make-frame "Silly" 150 100))
(add-button frame 30 30 90 40 "Push me" button-proc)


While we're at it, I'd like to make another suggestion.
Ideally, I want to construct graphical applications, but
propose kawa as a scripting/shell language as a means
of extending/customizing/automizing the environment. 
It would be usefull if the user could browse the variables and
procedures defined in the environment. In that way, the
graphical interface can propose the user all the variables of
a certain type, for example, in a dialog. Currently in Kawa, 
you can only access the binding table if you know the name or 
value of a variable. 

Peter