The widget passed to the callback routine is the DragContext object for the drag and drop transfer. The routine
retrieves the source icon from the DragContext and destroys it using XtDestroyWidget().
19.5 Working With Drop Sites
In order to handle data from drag sources that provide something other than textual data, an application has to register
drop sites that understand other types of data. To make the file_manager.c application useful, we need an application
that has drop sites that can handle file objects. In this section, we are going to modify the text editor from Chapter 14,
Text Widgets, so that it understands file data. The application contains two drop sites that handle files: the main text
entry area and a filename status area. the source code shows the main(), HandleDropLabel(),
HandleDropText(), and TransferProc() routines for editor_dnd.c. The rest of the routines in the application
are the same as in Section #stexteditor, so we have not shown them here.
/* editor_dnd.c −− create an editor application that contains drop sites
* that understand file data. A file can be dragged from another
* application and dropped in the text entry area or the filename status
* area.
*/
#include <Xm/Text.h>
#include <Xm/TextF.h>
#include <Xm/LabelG.h>
#include <Xm/PushBG.h>
#include <Xm/RowColumn.h>
#include <Xm/MainW.h>
#include <Xm/Form.h>
#include <Xm/FileSB.h>
#include <Xm/SeparatoG.h>
#include <Xm/DragDrop.h>
#include <X11/Xos.h>
#include <stdio.h>
#include <sys/types.h>
#include ...