tree view check boxes
I'm under the impression from the documentation that the tree view
object is supposed to be able display standard OS check boxes next to
each item. I can't seem to make it work. Perhaps I'm misunderstanding
and I have to create my own state images?
I found the code below on gmane (http://article.gmane.org/
gmane.lisp.lispworks.general/3175/match=tree+checkbox)
(in-package :cl-user)
(capi:define-interface test ()
()
(:panes
(simple-tree-view
capi:tree-view
:roots '(0 1 2 3 4 5 6 7 8 9)
:children-function (lambda (item) (and (< item 100)
(loop for i below 10
collect (+ i (*
item 10)))))
:use-images nil
:checkbox-status 2
:checkbox-initial-status (loop for i below 1000 collect (cons i
2))))
(:default-initargs
:best-width 300
:best-height 300))
(defun test ()
(capi:contain (make-instance 'test)))
It works as is on Windows but the check boxes don't appear to come
from the operating system (red check mark which extends slightly
outside the check box).
On the Mac, I get an error:
Condition: No applicable methods for #<STANDARD-GENERIC-FUNCTION
CAPI::IMAGE-LIST-LOCK 108997AA> with args (NIL)
Call to ERROR (offset 104)
SYSTEM::ESTRING : "No applicable methods for ~S with args ~S"
SYSTEM::EARGS : (#<STANDARD-GENERIC-FUNCTION CAPI::IMAGE-LIST-
LOCK 108997AA> (NIL))
Catch frame: (NIL)
Catch frame: (NIL)
Call to CERROR (offset 1028)
CONDITIONS::CONTINUE-STRING : "Call ~S again"
CONDITIONS::DATUM : "No applicable methods for ~S with
args ~S"
CONDITIONS::ARGUMENTS : (#<STANDARD-GENERIC-FUNCTION
CAPI::IMAGE-LIST-LOCK 108997AA> (NIL))
Call to (METHOD NO-APPLICABLE-METHOD (T)) (offset 80)
CLOS::GF : #<STANDARD-GENERIC-FUNCTION CAPI::IMAGE-LIST-LOCK
108997AA>
CLOS::ARGS : (NIL)
Call to CLOS::GENERIC-FUNCTION-NON-DISCRIMINATOR (offset 112)
Call to CLOS::STANDARD-READER-METHOD-DISCRIMINATOR (offset 156)
Call to CAPI::ENSURE-IMAGE-LIST (offset 188)
CAPI::USER : #<CAPI:TREE-VIEW SIMPLE-TREE-VIEW [0 items]
100D21B7>
CAPI:IMAGE-LIST : NIL
Call to (METHOD CAPI-LIBRARY:FINALIZE-REPRESENTATION :BEFORE (CAPI-
COCOA-LIBRARY::TREE-VIEW-REPRESENTATION)) (offset 168)
CAPI-COCOA-LIBRARY::REPRESENTATION : #<CAPI-COCOA-LIBRARY::TREE-
VIEW-REPRESENTATION for #<CAPI-INTERNALS:LIBRARY-TREE-VIEW
#<CAPI:TREE-VIEW SIMPLE-TREE-VIEW [0 items] 100D21B7> 100E630B>
100E80BF>
Binding frame:
CLOS::*NEXT-METHODS* : (#<Closure CLOS::METHOD-COMBINATION-TEMPLATE>)
Call to (METHOD CAPI::CREATE :AROUND (CAPI::LIBRARY-ELEMENT)) (offset
140)
CAPI::SELF : #<CAPI-INTERNALS:LIBRARY-TREE-VIEW #<CAPI:TREE-VIEW
SIMPLE-TREE-VIEW [0 items] 100D21B7> 100E630B>
LispWorks 4.4.6 Mac/Win
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL