andy128k / cl-gobject-introspection

BSD 2-Clause "Simplified" License
49 stars 15 forks source link

example in /test/hello.lisp doesn't work #38

Closed Q-tester closed 10 years ago

Q-tester commented 10 years ago

I fix it with this patch:

diff --git a/test/hello.lisp b/test/hello.lisp
index c83812e..9e80b8d 100644
--- a/test/hello.lisp
+++ b/test/hello.lisp
@@ -6,7 +6,7 @@

 (cffi:defcallback hello :void ((btn-ptr :pointer))
   (let ((button (funcall (gir:nget *gtk* "Button") btn-ptr)))
-    (gir:invoke (button :set-properties!) 'label "OK"))
+    (setf (gir:property button 'label) "OK"))
   (format t "Hello, pressed~%"))

 (defun main ()
@@ -14,7 +14,7 @@
   (let ((window (gir:invoke (*gtk* "Window" 'new)
                            (gir:nget *gtk* "WindowType" :toplevel)))
         (button (gir:invoke (*gtk* "Button" 'new-with-label) "Hello, world!")))
-    (gir::g-signal-connect-data (gir:nget window :this)
+    (gir::g-signal-connect-data (gir::object-this window)
                                 "destroy"
                                 (cffi:foreign-symbol-pointer "gtk_main_quit")
                                 (cffi:null-pointer)
@@ -28,7 +28,7 @@
     ;;                             0)
     (gir:connect button :clicked 
                  (lambda (button)
-                   (gir:invoke (button :set-properties!) 'label "OK")))
+                   (setf (gir:property button 'label) "OK")))
     (gir:invoke (window 'add) button)
     (gir:invoke (window 'show-all))
     (gir:invoke (*gtk* 'main))))
hying-caritas commented 10 years ago

Better to prepare a pull request for your fix?

Q-tester commented 10 years ago

Bad FFI method name THIS

Q-tester commented 10 years ago

hying-caritas, I'm sorry. I didn't catch your message. I meant that with fresh update the debugger types: "Bad FFI method name THIS".

Q-tester commented 10 years ago

Am I doing right?