All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

NextPrevUpTopContentsIndex

item-pane-interface-copy-object

Generic Function
Summary

Determines what pane-interface-copy-object returns from a choice.

Signature

item-pane-interface-copy-object item choice interface => object , string , plist

Description

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.

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. The 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))))
See also

pane-interface-copy-object
active-pane-copy
Edit actions on the active element


CAPI User Guide and Reference Manual (Unix version) - 3 Aug 2017

NextPrevUpTopContentsIndex