[ Team LiB ] Previous Section Next Section

The clipboard Command

The clipboard command manipulates values in the CLIPBOARD selection. The CLIPBOARD is meant for values that have been recently or temporarily deleted. It is use for the copy and paste model of selections. Prior to Tk 8.4, you had to use the selection command to retrieve values from the CLIPBOARD selection:

selection get -selection CLIPBOARD

However, Tk 8.4 introduced a clipboard get operation as a convenience for retrieving the clipboard value.

Table 38-2 summarizes the clipboard command:

Table 38-2. The clipboard command

clipboard append ?-displayof win? ?-format format? ?-type type? ?--? data

Appends data to the CLIPBOARD with the specified type and format, which both default to STRING.

clipboard clear ?-displayof win?

Clears the CLIPBOARD selection.

clipboard get ?-displayof win? ?-type type?

Returns the CLIPBOARD selection. The type defaults to STRING.

    [ Team LiB ] Previous Section Next Section