Atom *, XtPointer *, unsigned long *, int *);
Widget widget;
Atom *selection;
Atom *target;
Atom *type_return;
XtPointer *value_return;
unsigned long *length_return;
int *format_return;
The widget parameter is the DragContext for the drag operation, selection is the selection atom, which in this
case is _MOTIF_DROP, and target is the type of information requested about the selection. The type_return,
value_return, length_return, and format_return parameters return the type, value, length, and format
of the converted data. The routine should return True if the conversion succeeds and False otherwise. For more
information about this procedure type, see Volume Four, X Toolkit Intrinsics Programming Manual, and the
appropriate reference page in Volume Five, X Toolkit Intrinsics Reference Manual.
The ConvertProc() routine in the source code starts by retrieving the Label widget from the XmN-clientData
resource of the DragContext. The goal is to get an index into the files array so that we can access information about
the file. The index is stored in the -XmNuserData resource of the Label widget. Once we have the index, we can
use it to get the filename from the array.
Our conversion routine only handles requests for a filename or the contents of a file. If target is set to
FILE_CONTENTS, ConvertProc() retrieves the contents of the file and formats the data for transfer back to the
receiving client. The contents of the file are passed as a pointer to the text, using the value_return parameter. ...