All Manuals > LispWorks IDE User Guide > 8 The Object Clipboard

8.5 Using the Object Clipboard with a Listener

Here we place several objects on the Object Clipboard. Then we link the Object Clipboard with a Listener tool, giving a convenient way to manipulate these objects in turn.

In the Listener:

  1. Enter:
    (capi:contain 
     (make-instance 'capi:display-pane 
                    :text "Display Pane" 
                    :background :green))
    

    A green display pane is displayed.

  2. Ensure that the Listener window is active, so that the Values menu is enabled. Choose Values > Clip to place the display pane on the Object Clipboard.
  3. Enter:
    (capi:contain 
     (make-instance 'capi:editor-pane 
                    :text "Editor Pane" 
                    :background :yellow))
    

    A yellow editor pane is displayed.

  4. Return to the Listener and choose Values > Clip to place the editor pane on the Object Clipboard.
  5. Enter:
    (capi:contain 
     (make-instance 'capi:graph-pane))
    

    A graph pane is displayed.

  6. Return to the Listener and choose Values > Clip to place the graph pane on the Object Clipboard.

Now choose Window > Tools > Object Clipboard or click in the LispWorks toolbar. Notice that this creates an Object Clipboard tool if you do not already have one. The Object Clipboard shows the objects you just clipped, and the most recently clipped object appears at the top. It should look like CAPI panes in the Object Clipboard.

CAPI panes in the Object Clipboard

In the Listener choose Edit > Link from and select the Object Clipboard in the submenu. Now, whenever you select an object in the Object Clipboard, it is also pasted into the Listener - that is, it becomes the value of *. We use this link to manipulate the CAPI pane objects in the Listener.

  1. In the Object Clipboard select DISPLAY-PANE-1. This raises the linked Listener window and pastes the display pane object.
  2. Enter in the Listener:
    (capi:apply-in-pane-process 
     * #'(setf capi:simple-pane-background) :red *)
    

    The display pane background becomes red.

  3. In the Object Clipboard select EDITOR-PANE-1. This raises the linked Listener window and pastes the editor pane object.
  4. In the Listener choose History > Previous or use Esc P, and press Return, to enter the same command again:
    (capi:apply-in-pane-process 
     * #'(setf capi:simple-pane-background) :red *)
    

    The editor pane background also becomes red.

  5. In the Object Clipboard select GRAPH-PANE-1. This raises the linked Listener window and pastes the graph pane object.
  6. Enter in the Listener:
    (capi:apply-in-pane-process 
     * #'(setf capi:graph-pane-roots) '( 2 3) *)
    

    The graph pane is altered.

Notice how linking the Listener with the Object Clipboard allows you to manipulate the clipped objects in turn via the value of *.


LispWorks IDE User Guide (Macintosh version) - 01 Dec 2021 19:36:23