mplisp

miniPicoLisp with FFI and modules for Buddy BDD library, OpenGL, Gtk and GMP
git clone https://logand.com/git/mplisp.git/
Log | Files | Refs

gtk-demo2.l (1093B)


      1 (gtk_init 'NULL 'NULL) # ??? NIL instead of NULL???
      2 (glade_init)
      3 #(setq xml (glade_xml_new "glade.glade" 'NULL 'NULL))
      4 (setq xml (glade_xml_new "src/mod/gtk-demo2.glade" 'NULL 'NULL))
      5 
      6 (de handler (handlerName object signalName signalData connectObject after userData)
      7    (println (list handlerName object signalName signalData connectObject after userData))
      8    #(gtk_connect object signalName)
      9    )
     10 
     11 (glade_xml_signal_autoconnect_full xml 'handler 0)
     12 #(glade_xml_signal_autoconnect xml)
     13 #(setq win (glade_xml_get_widget xml 'window))
     14 #(gtk_server_connect win 'delete-event 'window)
     15 #(setq ebtn (glade_xml_get_widget xml 'exit_button))
     16 #(gtk_server_connect ebtn 'clicked 'exit_button)
     17 #(setq pbtn (glade_xml_get_widget xml 'print_button))
     18 #(gtk_server_connect pbtn 'clicked 'print_button)
     19 #(setq entry (glade_xml_get_widget xml 'entry))
     20 
     21 #(let event 0
     22 #   (until (prog
     23 #             (setq event (gtk_server_callback 'wait))
     24 #             (or (= event 'exit_button) (= event 'window)))
     25 #     (when (= event 'print_button)
     26 #        (prinl (gtk_entry_get_text entry)))))
     27 (gtk_main)
     28 
     29 (gtk_exit 0)