69 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <HTML><HEAD><TITLE>Tk Built-In Commands - clipboard manual page</TITLE></HEAD><BODY>
 | |
| <H3><A NAME="M2">NAME</A></H3>
 | |
| clipboard - Manipulate Tk clipboard
 | |
| <H3><A NAME="M3">SYNOPSIS</A></H3>
 | |
| <B>clipboard </B><I>option</I> ?<I>arg arg ...</I>?<BR>
 | |
| <H3><A NAME="M4">DESCRIPTION</A></H3>
 | |
| This command provides a Tcl interface to the Tk clipboard,
 | |
| which stores data for later retrieval using the selection mechanism.
 | |
| In order to copy data into the clipboard, <B>clipboard clear</B> must
 | |
| be called, followed by a sequence of one or more calls to <B>clipboard
 | |
| append</B>.  To ensure that the clipboard is updated atomically, all
 | |
| appends should be completed before returning to the event loop.
 | |
| <P>
 | |
| The first argument to <B>clipboard</B> determines the format of the
 | |
| rest of the arguments and the behavior of the command.  The following
 | |
| forms are currently supported:
 | |
| <P>
 | |
| <P>
 | |
| <DL>
 | |
| <P><DT><A NAME="M5"><B>clipboard clear</B> ?<B>-displayof</B> <I>window</I>?</A><DD>
 | |
| Claims ownership of the clipboard on <I>window</I>'s display and removes
 | |
| any previous contents.  <I>Window</I> defaults to ``.''.  Returns an
 | |
| empty string.
 | |
| <P><DT><A NAME="M6"><B>clipboard append</B> ?<B>-displayof</B> <I>window</I>? ?<B>-format</B> <I>format</I>? ?<B>-type</B> <I>type</I>? ?<B>- -</B>? <I>data</I></A><DD>
 | |
| Appends <I>data</I> to the clipboard on <I>window</I>'s
 | |
| display in the form given by <I>type</I> with the representation given
 | |
| by <I>format</I> and claims ownership of the clipboard on <I>window</I>'s
 | |
| display.
 | |
| <P>
 | |
| <I>Type</I> specifies the form in which the selection is to be returned
 | |
| (the desired ``target'' for conversion, in ICCCM terminology), and
 | |
| should be an atom name such as STRING or FILE_NAME; see the
 | |
| Inter-Client Communication Conventions Manual for complete details.
 | |
| <I>Type</I> defaults to STRING.
 | |
| <P>
 | |
| The <I>format</I> argument specifies the representation that should be
 | |
| used to transmit the selection to the requester (the second column of
 | |
| Table 2 of the ICCCM), and defaults to STRING.  If <I>format</I> is
 | |
| STRING, the selection is transmitted as 8-bit ASCII characters.  If
 | |
| <I>format</I> is ATOM, then the <I>data</I> is
 | |
| divided into fields separated by white space; each field is converted
 | |
| to its atom value, and the 32-bit atom value is transmitted instead of
 | |
| the atom name.  For any other <I>format</I>,  <I>data</I> is divided
 | |
| into fields separated by white space and each 
 | |
| field is converted to a 32-bit integer; an array of integers is
 | |
| transmitted to the selection requester.  Note that strings passed to
 | |
| <B>clipboard append</B> are concatenated before conversion, so the
 | |
| caller must take care to ensure appropriate spacing across string
 | |
| boundaries.  All items appended to the clipboard with the same
 | |
| <I>type</I> must have the same <I>format</I>.
 | |
| <P>
 | |
| The <I>format</I> argument is needed only for compatibility with
 | |
| clipboard requesters that don't use Tk.  If the Tk toolkit is being
 | |
| used to retrieve the CLIPBOARD selection then the value is converted back to
 | |
| a string at the requesting end, so <I>format</I> is
 | |
| irrelevant.
 | |
| <P>A <B>- -</B> argument may be specified to mark the end of options:  the
 | |
| next argument will always be used as <I>data</I>.
 | |
| This feature may be convenient if, for example, <I>data</I> starts
 | |
| with a <B>-</B>.
 | |
| <P></DL>
 | |
| <H3><A NAME="M7">KEYWORDS</A></H3>
 | |
| <A href="../Keywords/C.htm#clear">clear</A>, <A href="../Keywords/F.htm#format">format</A>, <A href="../Keywords/C.htm#clipboard">clipboard</A>, <A href="../Keywords/A.htm#append">append</A>, <A href="../Keywords/S.htm#selection">selection</A>, <A href="../Keywords/T.htm#type">type</A>
 | |
| <HR><PRE>
 | |
| <A HREF="../copyright.htm">Copyright</A> © 1994 The Regents of the University of California.
 | |
| <A HREF="../copyright.htm">Copyright</A> © 1994-1996 Sun Microsystems, Inc.
 | |
| <A HREF="../copyright.htm">Copyright</A> © 1995-1997 Roger E. Critchlow Jr.</PRE>
 | |
| </BODY></HTML>
 | 
