Lisp HUG Maillist Archive

DOUBLE-LIST-PANEL confusion

Hi CAPI users,

It's not clear to me whether this is a bug, or a consequence of my
failure to understand DOUBLE-LIST-PANEL. My intent was to display the
panel with it's :ITEMS appearing in the Selected Items pane, rather than
the (default) Unselected Items pane.

However, trouble is evident when attempting to move any one item in the
Selected Items pane to the Unselected Items pane. All items are moved,
instead of the single selected item.

Any advice, or admonishments welcome!

Brian C.

LWW 5.1.2

~~~~~~~~~~

(in-package :cl-user)


;; Simple instance of DOUBLE-LIST-PANEL
(setq panel (make-instance 'capi:double-list-panel :items '(a b c d e f g h i)))


;; Ugly (incorrect?) hack to transpose contents between ITEMS-PANEs
(with-slots (capi::selected-items-pane
             capi::deselected-items-pane) panel
  (let ((selected   (capi:collection-items capi::selected-items-pane))
        (deselected (capi:collection-items capi::deselected-items-pane)))
    (setf (capi:collection-items capi::selected-items-pane)   deselected)
    (setf (capi:collection-items capi::deselected-items-pane) selected)))


;; Display the resulting DOUBLE-LIST-PANEL
(capi:contain panel)

                              
;; Here's an uglier hack which leads to the same outcome
(with-slots (capi::selected-items-pane
             capi::deselected-items-pane) panel
  (let ((selected   (slot-value capi::selected-items-pane   'capi-internals:items-representation))
        (deselected (slot-value capi::deselected-items-pane 'capi-internals:items-representation)))
    (setf (slot-value capi::selected-items-pane   'capi-internals:items-representation) deselected)
    (setf (slot-value capi::deselected-items-pane 'capi-internals:items-representation) selected)))



Re: DOUBLE-LIST-PANEL confusion

Unable to parse email body. Email id is 9203

Updated at: 2020-12-10 08:41 UTC