1mNAME0m
       clipboard - Manipulate Tk clipboard

1mSYNOPSIS0m
       1mclipboard 4m22moption24m ?4marg24m 4marg24m 4m...24m?


1mDESCRIPTION0m
       This command provides a Tcl interface to the Tk clipboard, which stores
       data for later retrieval using the selection mechanism (via the 1m-selec-0m
       1mtion  CLIPBOARD  22moption).   In  order  to copy data into the clipboard,
       1mclipboard clear 22mmust be called, followed by a sequence of one  or  more
       calls  to  1mclipboard  append22m.   To ensure that the clipboard is updated
       atomically, all appends should be completed  before  returning  to  the
       event loop.

       The  first  argument  to 1mclipboard 22mdetermines the format of the rest of
       the arguments and the behavior of the command.  The following forms are
       currently supported:


       1mclipboard clear 22m?1m-displayof 4m22mwindow24m?
              Claims  ownership  of  the  clipboard  on  4mwindow24m's  display and
              removes  any  previous  contents.   4mWindow24m  defaults  to  ``.''.
              Returns an empty string.

       1mclipboard append 22m?1m-displayof 4m22mwindow24m? ?1m-format 4m22mformat24m? ?1m-type 4m22mtype24m? ?1m--22m?
       4mdata0m
              Appends  4mdata24m  to  the clipboard on 4mwindow24m's display in the form
              given by 4mtype24m with the representation given by 4mformat24m and claims
              ownership of the clipboard on 4mwindow24m's display.

              4mType24m 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.  4mType24m defaults to STRING.

              The  4mformat24m argument specifies the representation that should be
              used to transmit the selection to the requester (the second col-
              umn of Table 2 of the ICCCM), and defaults to STRING.  If 4mformat0m
              is STRING, the selection is transmitted as 8-bit  ASCII  charac-
              ters.   If  4mformat24m is ATOM, then the 4mdata24m 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 4mformat24m,  4mdata24m 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 1mclipboard append 22mare
              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 4mtype24m must have the  same
              4mformat24m.

              The  4mformat24m argument is needed only for compatibility with clip-
              board requesters that don't use Tk.  If the Tk toolkit is  being
              used  to retrieve the CLIPBOARD selection then the value is con-
              verted back to a string at the  requesting  end,  so  4mformat24m  is
              irrelevant.

              A  1m-- 22margument may be specified to mark the end of options:  the
              next argument will always be used as 4mdata24m.  This feature may  be
              convenient if, for example, 4mdata24m starts with a 1m-22m.

       1mclipboard get 22m?1m-displayof 4m22mwindow24m? ?1m-type 4m22mtype24m?
              Retrieve  data  from  the clipboard on 4mwindow24m's display.  4mwindow0m
              defaults to ".".  4mType24m specifies the form in which the  data  is
              to  be  returned  and  should  be an atom name such as STRING or
              FILE_NAME.  4mType24m defaults to STRING.  This command is equivalent
              to 1mselection get -selection CLIPBOARD22m.

1mEXAMPLES0m
       Get the current contents of the clipboard.
              if {[catch {1mclipboard get22m} contents]} {
                  # There were no clipboard contents at all
              }

       Set the clipboard to contain a fixed string.
              1mclipboard clear0m
              1mclipboard append 22m"some fixed string"


1mSEE ALSO0m
       selection(n)


1mKEYWORDS0m
