Next Previous Up Top Contents Index

5.3 DUIM-Sheets Module

with-clipboard

Statement macro

Summary

Evaluates a body of code with a clipboard grabbed.

Signature

with-clipboard (clipboard = sheet) body end

Arguments

clipboard
A Dylan variable-namebnf.

sheet
A Dylan variable-namebnf.

body
A Dylan bodybnf.

Values

values
Instances of <object>.

Library

duim-sheets

Module

duim-sheets

Description

Evaluates body with the clipboard grabbed, returning the results to the clipboard.

The macro grabs a lock on the clipboard, using open-clipboard, and then executes body. Once the results of evaluating body have been sent to the clipboard, the clipboard lock is freed using close-clipboard. The clipboard argument is a Dylan variable-namebnf used locally in the call to with-clipboard. The sheet argument is a Dylan variable-namebnf that evaluates to the sheet associated with clipboard.

This macro is the easiest way of manipulating the clipboard from DUIM, since it removes the need to create and destroy a clipboard lock yourself.

You can add more than one format of your data to the clipboard within the scope of this macro. So, for example, you could place an arbitrary object onto the clipboard, for use within your own application, and a string representation for other tools applications to see.

See also

<clipboard>, page 235


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index