Clipboard.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" Copyright (c) 1994 The Regents of the University of California.
- '" Copyright (c) 1994-1996 Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: Clipboard.3,v 1.2 1998/09/14 18:22:46 stanton Exp $
- '"
- .so man.macros
- .TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_ClipboardClear, Tk_ClipboardAppend - Manage the clipboard
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- int
- fBTk_ClipboardClearfR(fIinterp, tkwinfR)
- .sp
- int
- fBTk_ClipboardAppendfR(fIinterp, tkwin, target, format, bufferfR)
- .SH ARGUMENTS
- .AS Tk_ClipboardClear tkwin
- .AP Tcl_Interp *interp in
- Interpreter to use for reporting errors.
- .AP Tk_Window tkwin in
- Window that determines which display's clipboard to manipulate.
- .AP Atom target in
- Conversion type for this clipboard item; has same meaning as
- fItargetfR argument to fBTk_CreateSelHandlerfR.
- .AP Atom format in
- Representation to use when data is retrieved; has same meaning as
- fIformatfR argument to fBTk_CreateSelHandlerfR.
- .AP char *buffer in
- Null terminated string containing the data to be appended to the clipboard.
- .BE
- .SH DESCRIPTION
- .PP
- These two procedures manage the clipboard for Tk.
- The clipboard is typically managed by calling fBTk_ClipboardClearfR
- once, then calling fBTk_ClipboardAppendfR to add data for any
- number of targets.
- .PP
- fBTk_ClipboardClearfR claims the CLIPBOARD selection and frees any
- data items previously stored on the clipboard in this application.
- It normally returns TCL_OK, but if an error occurs it returns
- TCL_ERROR and leaves an error message in fIinterp->resultfR.
- fBTk_ClipboardClearfR must be called before a sequence of
- fBTk_ClipboardAppendfR calls can be issued.
- .PP
- fBTk_ClipboardAppendfR appends a buffer of data to the clipboard.
- The first buffer for a given fItargetfR determines the fIformatfR
- for that fItargetfR.
- Any successive appends for that fItargetfR must have
- the same format or an error will be returned.
- fBTk_ClipboardAppendfR returns TCL_OK if the buffer is
- successfully copied onto the clipboard. If the clipboard is not
- currently owned by the application, either
- because fBTk_ClipboardClearfR has not been called or because
- ownership of the clipboard has changed since the last call to
- fBTk_ClipboardClearfR,
- fBTk_ClipboardAppendfR returns TCL_ERROR and leaves an error message in
- fIinterp->resultfR.
- .PP
- In order to guarantee atomicity, no event handling should occur
- between fBTk_ClipboardClearfR and the following
- fBTk_ClipboardAppendfR calls (otherwise someone could retrieve
- a partially completed clipboard or claim ownership away from
- this application).
- .PP
- fBTk_ClipboardClearfR may invoke callbacks, including arbitrary
- Tcl scripts, as a result of losing the CLIPBOARD selection, so
- any calling function should take care to be reentrant at the point
- fBTk_ClipboardClearfR is invoked.
- .SH KEYWORDS
- append, clipboard, clear, format, type