# first drag and drop test
# drag the label (using the middle button) from l1 to l2
# and watch l2 change its label
# This is the first example given in the Motif Programmers Manual for DnD
xtAppInitialize -class Program

xmRowColumn .rc managed
xmPushButton .rc.l1 managed -labelString "number one"
xmPushButton .rc.l2 managed -labelString "number two"

.rc.l2 dropSiteRegister \
	-dropProc {startDrop %dragContext} \
	-numImportTargets 1 \
	-importTargets COMPOUND_TEXT

proc startDrop {dragContext} {
  $dragContext dropTransferStart \
	-dropTransfers {{COMPOUND_TEXT .rc.l2}} \
	-numDropTransfers 1 \
	-transferProc {doTransfer %closure {%value}}	
}

proc doTransfer {destination value} {

  $destination setValues -labelString $value
}

. realizeWidget

. mainLoop
