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-demo1.l (817B)


      1 (gtk_init 'NULL 'NULL)
      2 (setq win (gtk_window_new 0))
      3 (gtk_window_set_title win "'This is a title'")
      4 (gtk_window_set_default_size win 100 100)
      5 (gtk_window_set_position win 1)
      6 (setq table (gtk_table_new 30 30 1))
      7 (gtk_container_add win table)
      8 (setq button1 (gtk_button_new_with_label "'Exit'"))
      9 (gtk_table_attach_defaults table button1 17 28 20 25)
     10 (setq button2 (gtk_button_new_with_label "'Print text'"))
     11 (gtk_table_attach_defaults table button2 2 13 20 25)
     12 (setq entry (gtk_entry_new))
     13 (gtk_table_attach_defaults table entry 2 28 5 15)
     14 (gtk_widget_show_all win)
     15 
     16 #(let event 0
     17 #   (until (prog
     18 #             (setq event (gtk_server_callback 'wait))
     19 #             (or (= event button1) (= event win)))
     20 #     (when (= event button2)
     21 #        (prinl "Contents: " (gtk_entry_get_text entry)))))
     22 (gtk_main)
     23 
     24 (gtk_exit 0)