This example returns string data for a
tree-view
defined below:
(defun tree-drag-callback (pane indices)
(list :string
(string (elt (capi:collection-items pane)
(first indices)))))
(defun fruits (x)
(case x
(:fruits (list :apple :orange))
(:apple (list :cox :bramley))
(:orange (list :blood-orange :seville))
(t nil)))
(capi:contain
(make-instance 'capi:tree-view
:title "Fruit tree"
:roots '(:fruits)
:children-function 'fruits
:drag-callback 'tree-drag-callback))
There is a further example showing dragging from
list-panel
s in
examples/capi/choice/drag-and-drop.lisp
CAPI User Guide (Macintosh version) - 30 Aug 2011