[gtk-cffi-cvs] CVS gtk-cffi/examples

CVS User rklochkov rklochkov at common-lisp.net
Sun Jul 29 15:13:59 UTC 2012


Update of /project/gtk-cffi/cvsroot/gtk-cffi/examples
In directory tiger.common-lisp.net:/tmp/cvs-serv5173/examples

Modified Files:
	ex7.lisp 
Log Message:
Fixed memory leaks



--- /project/gtk-cffi/cvsroot/gtk-cffi/examples/ex7.lisp	2012/07/21 19:26:38	1.6
+++ /project/gtk-cffi/cvsroot/gtk-cffi/examples/ex7.lisp	2012/07/29 15:13:59	1.7
@@ -1,3 +1,4 @@
+(proclaim '(optimize debug))
 (asdf:oos 'asdf:load-op :gtk-cffi)
 (defpackage #:ex7
   (:use #:common-lisp #:gtk-cffi #:g-object-cffi))
@@ -7,6 +8,7 @@
 (defvar *cell-pix*)
 
 (defun main ()
+  (declare (optimize debug safety))
   (gtk-init)
 ;;   (rc-parse-string "style \"my\" {
 ;; GtkTreeView::even-row-color = \"#E7EDF6\"
@@ -65,9 +67,9 @@
                         (let ((%col col))
                           (lambda (cell path new-text)
                             (declare (ignore cell))
+                            (format t "path: ~a new-text:~a~%" path new-text)
                             (path->iter model path)
-                            (setf (model-values model
-                                                :col %col)
+                            (setf (model-values model :col %col)
                                   (list new-text)))))
 
                   (append-column view column))))
@@ -105,6 +107,7 @@
                 (setf (search-column view) i)))))
 
 (defun on-click (view path-list)
+  (format t "on-click: ~a~%" path-list)
   (when path-list
     (destructuring-bind (path column x y) path-list
       (declare (ignore y))
@@ -118,15 +121,16 @@
             (let ((text-view (make-instance 'text-view))
                   (iter (path->iter (model view) path)))
               (setf (text (buffer text-view))
-                    (car (model-values (model view) :columns '(1) :iter iter)))
+                    (car (model-values (model view) :columns '(1) 
+                                       :tree-iter iter)))
               (let ((top-area (content-area dialog)))
                 (pack top-area text-view :pack-fill t :expand t)
                 (show text-view)) 
-              (setf (window-position dialog) :center-on-parent)
+              (setf (position-type dialog) :center-on-parent)
               
                                         ;(pack top-area text-view :fill t :expand t))
               (run dialog)
-              (setf (model-values (model view) :columns '(1) :iter iter)
+              (setf (model-values (model view) :columns '(1) :tree-iter iter)
                     (list (text (buffer text-view))))
               (destroy dialog))))))))
                                                         





More information about the gtk-cffi-cvs mailing list