Update of /project/cells-gtk/cvsroot/root/cells-gtk In directory common-lisp.net:/tmp/cvs-serv8137/cells-gtk
Modified Files: tree-view.lisp Log Message: Return integer values from handlers. Date: Sat Feb 26 23:30:40 2005 Author: pdenno
Index: root/cells-gtk/tree-view.lisp diff -u root/cells-gtk/tree-view.lisp:1.9 root/cells-gtk/tree-view.lisp:1.10 --- root/cells-gtk/tree-view.lisp:1.9 Sat Feb 12 15:56:11 2005 +++ root/cells-gtk/tree-view.lisp Sat Feb 26 23:30:39 2005 @@ -46,9 +46,9 @@ (columns :accessor columns :initform (c? (mapcar #'(lambda (col-init) (apply #'make-be 'tree-view-column - :container self - col-init)) - (column-inits self)))) + :container self + col-init)) + (column-inits self)))) (select-if :unchanged-if #'fail :accessor select-if :initarg :select-if :initform (c-in nil)) (roots :accessor roots :initarg :roots :initform nil) @@ -82,7 +82,8 @@ (roots tree) (read-from-string (gtk-tree-model-get-cell model iter (length (column-types tree)) :string))) - (selected-items-cache tree)))) + (selected-items-cache tree))) + 0)
(defmethod get-selection ((self tree-view)) (let ((selection (gtk-tree-view-get-selection (id self))) @@ -108,12 +109,13 @@ (bif (tree-view (gtk-object-find column-widget)) (let ((cb (callback-recover tree-view :on-select))) (funcall cb tree-view column-widget event data)) - (trc "dude, clean up old widgets after runs" column-widget))) + (trc "dude, clean up old widgets after runs" column-widget)) + 0)
;;; The check that previously was performed here (for a clos object) caused the handler ;;; not to be registered (a problem of execution ordering?). Anyway, do we need such a check? (def-c-output on-select ((self tree-view)) - (when new-value + (when new-value (let ((selected-widget (gtk-tree-view-get-selection (id self)))) (gtk-object-store selected-widget self) ;; tie column widget to clos tree-view (callback-register self :on-select new-value) @@ -176,9 +178,9 @@ (when old-value (gtk-tree-store-clear (id (tree-model self)))) (when new-value - (loop for sub-tree in new-value + (loop for root in new-value for index from 0 do - (gtk-tree-store-set-kids (id (tree-model self)) sub-tree c-null index + (gtk-tree-store-set-kids (id (tree-model self)) root c-null index (append (column-types self) (list :string)) (print-fn self) (children-fn self)))))
@@ -212,7 +214,7 @@ nil nil) (gtk-tree-view-column-set-sort-column-id (id col) pos) (gtk-tree-view-insert-column (id self) (id col) pos)))) - + (def-object tree-view-column () ((title :accessor title :initarg :title :initform nil) (visible :accessor visible :initarg :visible :initform t))