File: dd-text.tcl

package info (click to toggle)
blt 2.4z-4.2
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 10,408 kB
  • ctags: 14,107
  • sloc: ansic: 113,289; tcl: 15,844; sh: 3,069; makefile: 856; cpp: 370; csh: 25
file content (48 lines) | stat: -rw-r--r-- 1,579 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# ----------------------------------------------------------------------
#  PURPOSE:  drag&drop send routine for "text" data
#
#  Widgets that are to participate in drag&drop operations for
#  "text" data should be registered as follows:
#
#      drag&drop .win source handler text dd_send_text
#      drag&drop .win target handler text my_text_handler
#
#      proc my_text_handler {} {
#          global DragDrop
#
#          set data $DragDrop(text)
#            .
#            .  do something with $data
#            .
#      }
#
#   AUTHOR:  Michael J. McLennan       Phone: (215)770-2842
#            AT&T Bell Laboratories   E-mail: aluxpo!mmc@att.com
#
#     SCCS:  %W% (%G%)
# ----------------------------------------------------------------------
#            Copyright (c) 1993  AT&T  All Rights Reserved
# ======================================================================

# ----------------------------------------------------------------------
# COMMAND: dd_send_text <interp> <ddwin> <data>
#
#   INPUTS
#     <interp> = interpreter for target application
#      <ddwin> = pathname for target drag&drop window
#       <data> = data returned from -tokencmd
#
#   RETURNS
#     ""
#
#   SIDE-EFFECTS
#     Sends data to remote application DragDrop(text), and then
#     invokes the "text" handler for the drag&drop target.
# ----------------------------------------------------------------------
proc dd_send_text {interp ddwin data} {
	send $interp "
		global DragDrop
		set DragDrop(text) [list $data]
	"
	send $interp "drag&drop target $ddwin handle text"
}