picolisp-gtk-server

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

glade-example.l (814B)


      1 # picoLisp + gtk-server example
      2 # 26feb2009 Tomas Hlavaty
      3 # $ ~/picolisp/p glade-example.l -bye
      4 # requires http://logand.com/gtk/gtk.l
      5 
      6 (load "gtk.l")
      7 
      8 (gtk_init 'NULL 'NULL)
      9 (glade_init)
     10 (setq X (glade_xml_new "glade-example.glade" 'NULL 'NULL))
     11 (glade_xml_signal_autoconnect X)
     12 (and (glade_xml_get_widget X 'window)
     13    (gtk_server_connect @ 'delete-event 'window) )
     14 (and (glade_xml_get_widget X 'exit_button)
     15    (gtk_server_connect @ 'clicked 'exit_button) )
     16 (and (glade_xml_get_widget X 'print_button)
     17    (gtk_server_connect @ 'clicked 'print_button) )
     18 (setq E (glade_xml_get_widget X 'entry))
     19 (let V 0
     20    (until (prog
     21              (setq V (gtk_server_callback 'wait))
     22              (or (= V 'exit_button) (= V 'window)) )
     23      (when (= V 'print_button)
     24         (prinl (gtk_entry_get_text E)) ) ) )
     25 (gtk_exit 0)