picolisp-gtk-server

picoLisp gtk-server interface
git clone https://logand.com/git/picolisp-gtk-server.git/
Log | Files | Refs

gtk.l (825B)


      1 # picoLisp + gtk-server wrapper
      2 # 26feb2009 Tomas Hlavaty
      3 # 26feb2009 minor fix by Peter van Eerten
      4 # available from http://logand.com/gtk/gtk.l
      5 
      6 (def '*GtkServer "gtk-server")
      7 
      8 (de gtk @
      9    (out *GtkFifo
     10       (while (args)
     11          (prin " ")
     12          (let A (next)
     13             (if (str? A)
     14                (prin "'" A "'")
     15                (prin A) ) ) )
     16       (prinl)
     17       (flush) )
     18    (in *GtkFifo
     19       (line T) ) )
     20 
     21 (de gtkCfg ()
     22    (in "gtk-server.cfg"
     23       (until (eof)
     24          (let L (line)
     25             (when (match '("F" "U" "N" @A "=" @B "," @C) L)
     26                (let N (intern (pack (clip @B)))
     27                   (def N (fill '(@ (pass gtk 'N)) 'N)) ) ) ) ) ) )
     28 
     29 (gtkCfg)
     30 (def '*GtkFifo (tmp "gtk.fifo"))
     31 (call *GtkServer (pack "-fifo=" *GtkFifo) "-detach")
     32 (push1 '*Bye (list 'kill (format (gtk_server_pid))))