X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/f0c3c3e59fe910d16608ccdb6ae58b368e664552..1c66c45f970603a0e638e641ea282b3e53f7c5c9:/hello-world.lisp diff --git a/hello-world.lisp b/hello-world.lisp index ab99220..9af70ab 100644 --- a/hello-world.lisp +++ b/hello-world.lisp @@ -1,20 +1,19 @@ -(use-package :gtk) +(gtk:clg-init) -(clg-init) - -(make-instance 'window -; :type :toplevel - :title "Test" - :border-width 5 - :visible t :show-children t - :child (make-instance 'button - :label "Hello World!" - :signal (list 'clicked - #'(lambda () - (write-line "Hello World!")))) - :signal (list 'delete-event - #'(lambda (event) - (declare (ignore event)) - (write-line "Destroying window") - nil ; Returning NIL generates a destroy event - ))) +(gtk:within-main-loop + (make-instance 'gtk:window +; :type :toplevel + :title "Test" + :border-width 5 + :visible t :show-children t + :child (make-instance 'gtk:button + :label "Hello World!" + :signal (list 'clicked + #'(lambda () + (write-line "Hello World!")))) + :signal (list 'delete-event + #'(lambda (event) + (declare (ignore event)) + (write-line "Destroying window") + nil ; Returning NIL generates a destroy event + ))))