[cells-gtk-devel] patch for dynamic columns

Novikov Leonid ln at bk.ru
Tue Jul 18 12:39:57 UTC 2006


This patch allows to change amount a columns in tree-view during execution.

For instance:

(defpackage :test
  (:use :common-lisp :cells :cells-gtk))
(in-package :test)
(defmodel mymodel ()
(( columns-list :cell t :accessor columns-list :initarg :columns-list 
:initform (c-in (def-columns (:string (:title "1"))))
               
 )
 (items-list :cell t :accessor items-list :initarg :items-list :initform 
(c-in nil)
             ))
)
(defvar *model* (make-instance 'mymodel))
(defmodel test-dyn-col (gtk-app)
()
(:default-initargs
;:md-name :test-dyn-col
:kids (list (mk-vbox :kids
             (list (mk-listbox :columns (c? (columns-list *model*))
                       :items (c? (items-list *model*)))
               (mk-button :on-clicked (callback (w e d)
                                (progn (setf (columns-list *model*) 
(list (list :string (list :title "1")) (list :string (list :title "2"))))
                                (setf (items-list *model*) (list (list 
"qwe" "wsx")))))))))))
(cells-gtk-init)
(cells-gtk:start-app 'test-dyn-col)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff2
URL: <https://mailman.common-lisp.net/pipermail/cells-gtk-devel/attachments/20060718/a84f1f2f/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff1
URL: <https://mailman.common-lisp.net/pipermail/cells-gtk-devel/attachments/20060718/a84f1f2f/attachment-0001.ksh>


More information about the cells-gtk-devel mailing list