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

CVS User rklochkov rklochkov at common-lisp.net
Sat Jan 21 18:35:00 UTC 2012


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

Modified Files:
	ex9.lisp 
Added Files:
	ex10.lisp 
Log Message:
Refactored defslots/def*funs



--- /project/gtk-cffi/cvsroot/gtk-cffi/examples/ex9.lisp	2011/09/10 16:26:10	1.2
+++ /project/gtk-cffi/cvsroot/gtk-cffi/examples/ex9.lisp	2012/01/21 18:35:00	1.3
@@ -1,7 +1,7 @@
-(asdf:oos 'asdf:load-op :gtk-cffi)
+(asdf:oos 'asdf:load-op :gtk-cffi-ext)
 ;(declaim (optimize speed))
 (defpackage #:test
-  (:use #:common-lisp #:iter #:gtk-cffi #:g-object-cffi))
+  (:use #:common-lisp #:iter #:gtk-cffi #:gtk-cffi-ext #:g-object-cffi))
 (in-package #:test)
 
 (gtk-init)
@@ -24,7 +24,7 @@
 (let ((arr (make-array 0 :adjustable t :fill-pointer 0)))
   (iter (for i from 1 to 100000)
         (vector-push-extend (list (format nil "str ~a" i) i) arr))
-  (setf (gtk-cffi::larray (gtk-cffi::implementation *model*)) arr))
+  (setf (larray (implementation *model*)) arr))
 
 (defparameter *window*
   (gtk-model
@@ -34,7 +34,7 @@
     ('scrolled-window
      ('tree-view :model *model* :columns '("Test str" "Test int"))))); "Test int"))))
 
-(show *window*)
+;(show *window*)
 (show #(1 2 3 4 5))
 
 (gtk-main)

--- /project/gtk-cffi/cvsroot/gtk-cffi/examples/ex10.lisp	2012/01/21 18:35:00	NONE
+++ /project/gtk-cffi/cvsroot/gtk-cffi/examples/ex10.lisp	2012/01/21 18:35:00	1.1
(asdf:oos 'asdf:load-op :gtk-cffi-ext)
;(declaim (optimize speed))
(defpackage #:test-10
  (:use #:common-lisp #:iter #:gtk-cffi #:gtk-cffi-ext #:g-object-cffi))
(in-package #:test-10)

(gtk-init)
(defparameter *model*
  (make-instance 'lisp-model
                 :implementation
                 (make-instance 'lisp-model-tree-array
                                :tree '((("ok" 1) 
                                         (("Ok2" 2))) 
                                        (("ok3" 3)))
                                :columns '(:string :int))))
                                ;:array #(("ok" 1))
                                ;:columns '(:string :int))))

;; (defparameter *model0*
;;   (make-instance 'list-store :columns '(:int)))

;; (append-values *model0* '(1))
;; (append-values *model0* '(2))
;; (append-values *model0* '(3))

;; (let ((arr (make-array 0 :adjustable t :fill-pointer 0)))
;;   (iter (for i from 1 to 100000)
;;         (vector-push-extend (list (format nil "str ~a" i) i) arr))
;;   (setf (larray (implementation *model*)) arr))

(defparameter *window*
  (gtk-model
    'window :width 400
            :height 400
            :signals '(:destroy :gtk-main-quit)
    ('scrolled-window
     ('tree-view :model *model* :columns '("Test str" "Test int")))))


;(show *window*)
;(show #(1 2 3 4 5))

(show (make-instance 'lisp-model-tree-array
                     :tree '((("ok" 1) 
                              (("Ok2" 2))) 
                             (("ok3" 3)))
                     :columns '(:string :int))
      :columns '("str" "int"))

(show '((1 2 3) 4))

(gtk-main)




More information about the gtk-cffi-cvs mailing list