/[gtk-cffi]/gtk-cffi/examples/ex10.lisp
ViewVC logotype

Contents of /gtk-cffi/examples/ex10.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Sat Jan 21 18:35:00 2012 UTC (2 years, 3 months ago) by rklochkov
Branch: MAIN
CVS Tags: HEAD
Refactored defslots/def*funs
1 rklochkov 1.1 (asdf:oos 'asdf:load-op :gtk-cffi-ext)
2     ;(declaim (optimize speed))
3     (defpackage #:test-10
4     (:use #:common-lisp #:iter #:gtk-cffi #:gtk-cffi-ext #:g-object-cffi))
5     (in-package #:test-10)
6    
7     (gtk-init)
8     (defparameter *model*
9     (make-instance 'lisp-model
10     :implementation
11     (make-instance 'lisp-model-tree-array
12     :tree '((("ok" 1)
13     (("Ok2" 2)))
14     (("ok3" 3)))
15     :columns '(:string :int))))
16     ;:array #(("ok" 1))
17     ;:columns '(:string :int))))
18    
19     ;; (defparameter *model0*
20     ;; (make-instance 'list-store :columns '(:int)))
21    
22     ;; (append-values *model0* '(1))
23     ;; (append-values *model0* '(2))
24     ;; (append-values *model0* '(3))
25    
26     ;; (let ((arr (make-array 0 :adjustable t :fill-pointer 0)))
27     ;; (iter (for i from 1 to 100000)
28     ;; (vector-push-extend (list (format nil "str ~a" i) i) arr))
29     ;; (setf (larray (implementation *model*)) arr))
30    
31     (defparameter *window*
32     (gtk-model
33     'window :width 400
34     :height 400
35     :signals '(:destroy :gtk-main-quit)
36     ('scrolled-window
37     ('tree-view :model *model* :columns '("Test str" "Test int")))))
38    
39    
40     ;(show *window*)
41     ;(show #(1 2 3 4 5))
42    
43     (show (make-instance 'lisp-model-tree-array
44     :tree '((("ok" 1)
45     (("Ok2" 2)))
46     (("ok3" 3)))
47     :columns '(:string :int))
48     :columns '("str" "int"))
49    
50     (show '((1 2 3) 4))
51    
52     (gtk-main)

  ViewVC Help
Powered by ViewVC 1.1.5