All Manuals > CAPI User Guide > 16 Drag and Drop > 16.2 Dragging > 16.2.1 Dragging values from a choice

NextPrevUpTopContentsIndex

16.2.1.1 Example: dragging from a tree

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 (Windows version) - 30 Aug 2011

NextPrevUpTopContentsIndex