1Clipboard(3) User Contributed Perl Documentation Clipboard(3)
2
3
4
6 Tk::clipboard - Manipulate Tk clipboard
7
9 $widget->clipboardOption?(args)?
10
12 This command provides an interface to the Tk clipboard, which stores
13 data for later retrieval using the selection mechanism. In order to
14 copy data into the clipboard, clipboardClear must be called, followed
15 by a sequence of one or more calls to clipboardAppend. To ensure that
16 the clipboard is updated atomically, all appends should be completed
17 before returning to the event loop.
18
19 The following methods are currently supported:
20
21 $widget->clipboardClear
22 Claims ownership of the clipboard on $widget's display and removes
23 any previous contents. Returns an empty string.
24
25 $widget->clipboardAppend(?-format=>format?,?-type=>type?,?--?,data)
26 Appends data to the clipboard on $widget's display in the form
27 given by type with the representation given by format and claims
28 ownership of the clipboard on $widget's display.
29
30 Type specifies the form in which the selection is to be
31 returned (the desired ``target'' for conversion, in ICCCM
32 terminology), and should be an atom name such as STRING or
33 FILE_NAME; see the Inter-Client Communication Conventions
34 Manual for complete details. Type defaults to STRING.
35
36 The format argument specifies the representation that should be
37 used to transmit the selection to the requester (the second
38 column of Table 2 of the ICCCM), and defaults to STRING. If
39 format is STRING, the selection is transmitted as 8-bit ASCII
40 characters. See the Tk::Selection documentation for
41 explanation of what happens if format is not STRING. Note that
42 arguments passed to clipboardAppend are concatenated before
43 conversion, so the caller must take care to ensure appropriate
44 spacing across string boundaries. All items appended to the
45 clipboard with the same type must have the same format.
46
47 A -- argument may be specified to mark the end of options: the
48 next argument will always be used as data. This feature may be
49 convenient if, for example, data starts with a -.
50
51 $widget->clipboardGet( ?-type? );
52 Retrieve data from the clipboard on widget's display. -type
53 specifies the form in which the data is to be returned and should
54 be an atom name such as STRING or FILE_NAME. Type defaults to
55 STRING. This command is equivalent to "SelectionGet( -selection =>
56 'CLIPBOARD' )".
57
59 clear, format, clipboard, append, selection, type
60
61
62
63perl v5.38.0 2023-07-21 Clipboard(3)