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:

Enter

(capi:contain

(make-instance 'capi:display-pane

:text "Display Pane"

:background :green))

A green display pane is displayed.

Ensure that the Listener window is active, so that the
Works > Values
menu is enabled. Choose
Works > Values > Clip
to place the display pane on the Object Clipboard.

Enter

(capi:contain

(make-instance 'capi:editor-pane

:text "Editor Pane"

:background :yellow))

A yellow editor pane is displayed.

Return to the Listener and choose
Works > Values > Clip
to place the editor pane on the Object Clipboard.

Enter

(capi:contain

(make-instance 'capi:graph-pane))

A graph pane is displayed.

Return to the Listener and choose
Works > 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 8.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.

In the Object Clipboard select DISPLAY-PANE-1. This raises the linked Listener window and pastes the display pane object.

Enter in the Listener:

(capi:apply-in-pane-process

* #'(setf capi:simple-pane-background) :red *)

The display pane background becomes red.

In the Object Clipboard select EDITOR-PANE-1. This raises the linked Listener window and pastes the editor pane object.

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.

In the Object Clipboard select GRAPH-PANE-1. This raises the linked Listener window and pastes the graph pane object.

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
*
.