home *** CD-ROM | disk | FTP | other *** search
/ Practical Programming in Tcl & Tk (4th Edition) / TCLBOOK4.BIN / pc / exsource.old / 36_1.tcl < prev    next >
Text File  |  2003-04-15  |  259b  |  17 lines

  1. #
  2. # Example 36-1
  3. # Paste the PRIMARY or CLIPBOARD selection.
  4. #
  5.  
  6. proc Paste { text } {
  7.     if [catch {selection get} sel] {
  8.         if [catch {selection get -selection CLIPBOARD} sel] {
  9.             # no selection or clipboard data
  10.             return
  11.         }
  12.     }
  13.     $text insert insert $sel
  14. }
  15.  
  16.  
  17.