Determines what pane-interface-copy-object returns from a choice.
capi
item-pane-interface-copy-object item choice interface => object, string, plist
item⇩ |
A Lisp object that is one of the items of choice. |
choice⇩ |
A choice within interface. |
interface⇩ |
An interface. |
object |
A Lisp object. |
string |
A string. |
plist⇩ |
A plist. |
The generic function item-pane-interface-copy-object
is used by the method of pane-interface-copy-object that specializes on choice to decide what to return.
item is one of the items of choice, which is a choice within interface.
If only one item is selected, the pane-interface-copy-object method for choice returns what item-pane-interface-copy-object
returns for this item. In this case all three of the return values are used.
If multiple items are selected, pane-interface-copy-object applies item-pane-interface-copy-object
to each one, and returns a list of the returned objects as the first value, and a concatenation of returned strings (separated by newlines) as the second value. plist is ignored if the there more than one element.
The default method returns the item and its print representation (using the print-function of the choice), and no third return value.
You can define your own methods for item-pane-interface-copy-object
. This is useful to make active-pane-copy work properly for a choice, in cases where the actual items in the choice are not the objects that are displayed in the choice as far as the user is concerned. For example, you may have a structure:
(defstruct my-item real-object color)
To give different colors to different lines in a list-panel. In this case pane-interface-copy-object (and hence active-pane-copy when the list-panel is active) will return the my-item
structure, while the user will expect the real object. This can be fixed by adding a method:
(defmethod item-pane-interface-copy-object ((item my-item) pane interface) (let ((real-object (my-item-real-object item))) (values real-object (print-a-real-object real-object))))
pane-interface-copy-object
active-pane-copy
7.6 Edit actions on the active element
CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42