Atom *selection;
Atom *type;
XtPointer value;
unsigned long *length;
int *format;
The widget parameter is the widget that requested the data, and client_data is the data specified in the
client_data field of the XmDropTransferEntryRec that is being processed. The type, value, length,
and format arguments contain the data that was converted by the drag source in its XmN-convertProc.
The TransferProc() routine in the source code checks the type to determine what needs to be done with the
data. If the data is FILE_CONTENTS data, the text in value is placed in the Text widget with
XmTextSetString(). Otherwise, the text is used to create a new value for XmN-labelString for the file
status area. Since the file status area requests both target data types, both formats are processed by
TransferProc().
The HandleDropText() routine for the ScrolledText object is very similar to HandleDropLabel(). The main
difference is that the routine for the text area checks the XmN-exportTargets resource of the DragContext object
to determine whether or not the drag source provides file data. If it does, HandleDropText() initiates the data
transfer just as in HandleDropLabel(). Otherwise, the text routine calls the XmN-dropProc that we retrieved
from the Text widget when we modified the drop site. By calling the original drop routine, we allow the Text widget
to process textual data as it would by default. As a result, the user can drop a file object in the text entry area, as well
as manipulate textual data in ...