Update of /project/cells-gtk/cvsroot/root/gtk-ffi In directory common-lisp.net:/tmp/cvs-serv9151/gtk-ffi
Modified Files: gtk-utilities.lisp Log Message: Cleaned up so that it doesn't generate strings and intern just to call g-value functions. Date: Sun May 29 23:24:10 2005 Author: pdenno
Index: root/gtk-ffi/gtk-utilities.lisp diff -u root/gtk-ffi/gtk-utilities.lisp:1.13 root/gtk-ffi/gtk-utilities.lisp:1.14 --- root/gtk-ffi/gtk-utilities.lisp:1.13 Sat Feb 26 23:44:48 2005 +++ root/gtk-ffi/gtk-utilities.lisp Sun May 29 23:24:10 2005 @@ -16,6 +16,7 @@
|#
+;;; Function with equivalents in gtklib.
(in-package :gtk-ffi)
@@ -163,21 +164,22 @@ (gtk-tree-store-newv (length col-types) gtk-types)))
(defun gtk-tree-store-set (tstore iter types-lst data-lst) + "Sets the value of one or more cells in a row referenced by iter." (with-g-value (value) (loop for col from 0 for data in data-lst for type in types-lst do ;; (print (list :tree-store-set value type (as-gtk-type type))) (g-value-init value (as-gtk-type type)) - (funcall (intern (format nil "G-VALUE-SET-~a" (case type - (:date 'float) - (:icon 'string) - (t type))) - :gtk-ffi) + (funcall (case type + ((:string :icon) #'g-value-set-string) + (:int #'g-value-set-int) + (:long #'g-value-set-long) + (:boolean #'g-value-set-boolean) + ((:float :date) #'g-value-set-float) + (t (error "Invalid type: ~S?" type))) value - (if (eql type :date) - (coerce data 'single-float) - data)) + (if (eql type :date) (coerce data 'single-float) data)) (gtk-tree-store-set-value tstore iter col value) (g-value-unset value))))