chiark / gitweb /
Fix compilation for Gtk with the new, stricter inheritance
[clg] / hello-world.lisp
index d89a58539bfe3e85b4133d5c180a1c4cafd813a3..9af70abf56a8aadc93354469557693778a970716 100644 (file)
@@ -1,15 +1,19 @@
-(use-package "GTK")
-
-(make-instance 'window
- :type :toplevel
- :title "Test"
- :border-width 5
- :visible t
- :child (make-instance 'button
-        :label "Hello World!"
-        :visible t
-        :signals
-        (list (list 'clicked #'(lambda () (write-line "Button clicked"))))))
-
-
+(gtk:clg-init)
 
+(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
+               ))))