
Output of editor_dnd.c
19.5.2 Modifying an Existing Drop Site
The editor_dnd.c application also allows the user to drag a file from file_manager.c to the main text entry area and
drop it. This action causes the contents of the file to be copied to the Text widget. By default, the Text widget also has
its own drop site functionality that allows the user to drop textual data. We want to modify the drop site to incorporate
our own functionality but still allow the user to drag and drop textual data in the widget. The Text widget has already
been registered as a drop site by the Motif toolkit, so we do not need to call XmDropSiteRegister(). In fact, if
we did call that routine, we would override the default functionality.
Instead, we call XmDropSiteRetrieve() to get the values of the XmN-importTargets,
XmN-numImportTargets, and XmN-dropProc resources for the Text widget drop site, as shown in the
following fragment:
n = 0;
19 Drag and Drop 19.5.2 Modifying an Existing Drop Site
553