home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / TCL / BLT / _BLT.TAR / usr / lib / blt / dd_protocols / dd-text.tcl < prev    next >
Encoding:
Text File  |  1994-09-14  |  1.5 KB  |  49 lines

  1. # ----------------------------------------------------------------------
  2. #  PURPOSE:  drag&drop send routine for "text" data
  3. #
  4. #  Widgets that are to participate in drag&drop operations for
  5. #  "text" data should be registered as follows:
  6. #
  7. #      drag&drop .win source handler text dd_send_text
  8. #      drag&drop .win target handler text my_text_handler
  9. #
  10. #      proc my_text_handler {} {
  11. #          global DragDrop
  12. #
  13. #          set data $DragDrop(text)
  14. #            .
  15. #            .  do something with $data
  16. #            .
  17. #      }
  18. #
  19. #   AUTHOR:  Michael J. McLennan       Phone: (215)770-2842
  20. #            AT&T Bell Laboratories   E-mail: aluxpo!mmc@att.com
  21. #
  22. #     SCCS:  %W% (%G%)
  23. # ----------------------------------------------------------------------
  24. #            Copyright (c) 1993  AT&T  All Rights Reserved
  25. # ======================================================================
  26.  
  27. # ----------------------------------------------------------------------
  28. # COMMAND: dd_send_text <interp> <ddwin> <data>
  29. #
  30. #   INPUTS
  31. #     <interp> = interpreter for target application
  32. #      <ddwin> = pathname for target drag&drop window
  33. #       <data> = data returned from -tokencmd
  34. #
  35. #   RETURNS
  36. #     ""
  37. #
  38. #   SIDE-EFFECTS
  39. #     Sends data to remote application DragDrop(text), and then
  40. #     invokes the "text" handler for the drag&drop target.
  41. # ----------------------------------------------------------------------
  42. proc dd_send_text {interp ddwin data} {
  43.     send $interp "
  44.         global DragDrop
  45.         set DragDrop(text) [list $data]
  46.     "
  47.     send $interp "blt_drag&drop target $ddwin handle text"
  48. }
  49.