hw2.ls (656B)
1 ;;; http://common-lisp.net/project/lgtk/hw.html 2 3 (defun main () 4 (load-xml "hw2.glade" 5 (lambda (glade) 6 (let ((widgets (parse-glade glade))) 7 (wbuild document.document-element 8 (array (slot-value widgets "window1"))))))) 9 10 ;; TODO handler args? 11 12 (defhandler "callback" (e) ;;(wid num) 13 ;;(let ((num (if (eq source (find-widget-by-name app "button1")) 1 2))) 14 (alert (+ "Hello again - " e.target.id " was pressed."))) 15 16 (defhandler "delete_handler" (hw2) 17 (gtk-main-quit)) 18 19 ;;(g-signal-connect button1 gtkclicked #'callback :data 1) 20 ;;(g-signal-connect button2 gtkclicked #'callback :data 2)