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

  1. #
  2. # Example 36-6
  3. # The copy and cut operations.
  4. #
  5.  
  6. proc CanvasCopy { w } {
  7.     global canvas
  8.     if [info exists canvas(select,$w)] {
  9.         set id $canvas(select,$w)
  10.         clipboard clear
  11.         clipboard append [CanvasDescription $w $id]
  12.     }
  13. }
  14. proc CanvasDelete {w} {
  15.     global canvas
  16.     catch {
  17.         $w delete highlight
  18.         $w delete $canvas(select,$w)
  19.         unset canvas(select,$w)
  20.     }
  21. }
  22. proc CanvasCut { w } {
  23.     CanvasCopy $w
  24.     CanvasDelete $w
  25. }
  26.  
  27.  
  28.