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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations)
Sun Oct 7 12:02:11 2012 UTC (18 months, 2 weeks ago) by rklochkov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +4 -4 lines
Fixed examples. Changed cell properties for tree-column to be set as :attributes
Fixed double init in g-value.
1 (asdf:oos 'asdf:load-op :gtk-cffi-ext)
2 (declaim (optimize speed))
3 (defpackage #:test9
4 (:use #:common-lisp #:iter #:gtk-cffi #:gtk-cffi-ext #:g-object-cffi))
5 (in-package #:test9)
6
7 (gtk-init)
8 (defparameter *model*
9 (make-instance 'lisp-model
10 :implementation
11 (make-instance 'lisp-model-array
12 :array #((1) (2) (3))
13 :columns '(:string :int))))
14 ;:array #(("ok" 1))
15 ;:columns '(:string :int))))
16
17 (defparameter *model0*
18 (make-instance 'list-store :columns '(:int)))
19
20 (append-values *model0* '(1))
21 (append-values *model0* '(2))
22 (append-values *model0* '(3))
23
24 (let ((arr (make-array 0 :adjustable t :fill-pointer 0)))
25 (iter (for i from 1 to 100000) ;; benchmark
26 (vector-push-extend (list (format nil "str ~a" i) i) arr))
27 (setf (larray (implementation *model*)) arr))
28
29 (defparameter *window*
30 (gtk-model
31 'window :width 400
32 :height 400
33 :signals '(:destroy :gtk-main-quit)
34 ('scrolled-window
35 ('tree-view :model *model* :columns '("Test str" "Test int"))))); "Test int"))))
36
37 (show *window*)
38 ;(show #(1 2 3 4 5))
39
40 (gtk-main)

  ViewVC Help
Powered by ViewVC 1.1.5