Arg args[10];
int n;
Widget label;
Atom importList[1];
void HandleDrop();
...
n = 0;
importList[0] = COMPOUND_TEXT;
XtSetArg (args[n], XmNimportTargets, importList); n++;
XtSetArg (args[n], XmNnumImportTargets, XtNumber (importList)); n++;
XtSetArg (args[n], XmNdropSiteOperations, XmDROP_COPY); n++;
XtSetArg (args[n], XmNdropProc, HandleDrop); n++;
XmDropSiteRegister (label, args, n);
When a drop occurs in the drop site, the XmN-dropProc is called automatically by the Motif toolkit. This routine
must call XmDropTransferStart() whether or not the drop is -successful. XmDropTransferStart()
creates a DropTransfer object that maintains information about the data transfer. When The DropTransfer object is
created, the XmN-transferStatus resource must be set to indicate the success or failure of the drop. If the
resource is set to XmTRANSFER_FAILURE, XmDropTransferStart() does not transfer any data and merely
cleans up after the drag and drop transfer.
If XmN-transferStatus is set to XmTRANSFER_SUCCESS when the DropTransfer object is created, some other
resources must also be specified to cause the data to be transferred. The XmN-dropTransfers and
XmN-numDropTransfers resources specify the data targets to be processed, while XmN-transferProc
indicates the procedure that receives the converted data from the drag source. This procedure is of type
XtSelectionCallbackProc. Once the data transfer has started, XmDropTransferAdd() can be used to
request the processing of additional data targets. In ...