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

NextPrevUpTopContentsIndex

9.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
  2. (capi:contain 
     (make-instance 'capi:display-pane 
                    :text "Display Pane" 
                    :background :green))

    A green display pane is displayed.

  3. 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.
  4. Enter
  5. (capi:contain 
     (make-instance 'capi:editor-pane 
                    :text "Editor Pane" 
                    :background :yellow))

    A yellow editor pane is displayed.

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

    A graph pane is displayed.

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

Now choose Tools > Object Clipboard or click in the Podium. 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.

Figure 9.4 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:
  3. (capi:apply-in-pane-process 
     * #'(setf capi:simple-pane-background) :red *)

    The display pane background becomes red.

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

    The editor pane background also becomes red.

  7. In the Object Clipboard select GRAPH-PANE-1. This raises the linked Listener window and pastes the graph pane object.
  8. Enter in the Listener:
  9. (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 (Unix version) - 12 Feb 2015

NextPrevUpTopContentsIndex