list-panel selection callback
Is there a method to ensure the selection callback is called when the
selection (visibly) changes or to clear the visible selection? Ideally,
while filtering, if the current selection is filtered, keep it. If the
currently selected item is removed, then clear the current selection.
Here's an example:
(defclass test (capi:list-panel)
()
(:default-initargs
:filter t
:selection-callback #'(lambda (item) (capi:display-message "~a
selected" item))
:callback-type :data
:items '(one two three four five six seven)))
(capi:contain (make-instance 'test))
Now, first off, ONE is selected, but there was no callback. If I call
#'choice-selected-item on the pane, it will also return ONE.
If I type 'T' in the filter, now ONE is no longer visible. Calling
#'choice-selected-item now will return TWO, but I didn't receive a
selection callback to indicate that the selection changed.
If I clear the filter, the selected item is now ONE again. This is
horrible. It *was* TWO, but suddenly changed back to a different
selected item for no apparent reason. And there was no callback to
indicate that it happened.
To get the behavior I'm looking for, would I be responsible for creating
my own filtering-layout and doing everything myself or am I missing
something obvious?
Thanks!
Side-note: since LW 7.0 has come up a couple times here recently, I
thought I'd mention that it'd be great if the filtering-layout in 7.0
used the search controls on OS X and some better icons on Windows. ;-)
Jeff M.
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html