1Tk_ClipboardClear(3) Tk Library Procedures Tk_ClipboardClear(3)
2
3
4
5______________________________________________________________________________
6
8 Tk_ClipboardClear, Tk_ClipboardAppend - Manage the clipboard
9
11 #include <tk.h>
12
13 int
14 Tk_ClipboardClear(interp, tkwin)
15
16 int
17 Tk_ClipboardAppend(interp, tkwin, target, format, buffer)
18
20 Tcl_Interp *interp (in) Interpreter to use for reporting
21 errors.
22
23 Tk_Window tkwin (in) Window that determines which dis‐
24 play's clipboard to manipulate.
25
26 Atom target (in) Conversion type for this clip‐
27 board item; has same meaning as
28 target argument to Tk_CreateSel‐
29 Handler.
30
31 Atom format (in) Representation to use when data
32 is retrieved; has same meaning
33 as format argument to Tk_Create‐
34 SelHandler.
35
36 char *buffer (in) Null terminated string containing
37 the data to be appended to the
38 clipboard.
39_________________________________________________________________
40
41
43 These two procedures manage the clipboard for Tk. The clipboard is
44 typically managed by calling Tk_ClipboardClear once, then calling
45 Tk_ClipboardAppend to add data for any number of targets.
46
47 Tk_ClipboardClear claims the CLIPBOARD selection and frees any data
48 items previously stored on the clipboard in this application. It nor‐
49 mally returns TCL_OK, but if an error occurs it returns TCL_ERROR and
50 leaves an error message in interp->result. Tk_ClipboardClear must be
51 called before a sequence of Tk_ClipboardAppend calls can be issued.
52
53 Tk_ClipboardAppend appends a buffer of data to the clipboard. The
54 first buffer for a given target determines the format for that target.
55 Any successive appends for that target must have the same format or an
56 error will be returned. Tk_ClipboardAppend returns TCL_OK if the buf‐
57 fer is successfully copied onto the clipboard. If the clipboard is not
58 currently owned by the application, either because Tk_ClipboardClear
59 has not been called or because ownership of the clipboard has changed
60 since the last call to Tk_ClipboardClear, Tk_ClipboardAppend returns
61 TCL_ERROR and leaves an error message in interp->result.
62
63 In order to guarantee atomicity, no event handling should occur between
64 Tk_ClipboardClear and the following Tk_ClipboardAppend calls (otherwise
65 someone could retrieve a partially completed clipboard or claim owner‐
66 ship away from this application).
67
68 Tk_ClipboardClear may invoke callbacks, including arbitrary Tcl
69 scripts, as a result of losing the CLIPBOARD selection, so any calling
70 function should take care to be reentrant at the point Tk_Clipboard‐
71 Clear is invoked.
72
73
75 append, clipboard, clear, format, type
76
77
78
79Tk 4.0 Tk_ClipboardClear(3)