19 Drag and Drop
This chapter describes the drag and drop mechanism provided by the Motif toolkit. Drag and drop can be used to
transfer data within and between applications on the desktop.
A graphical user interface provides objects that the user can manipulate and actions that can be performed on those
objects. The drag and drop mechanism for transferring data is a natural one for a GUI, as drag and drop allows the
user to transport data within and between applications by dragging an iconic representation of the data from one
location to another. The ability to transfer data using drag and drop is new in Motif 1.2.
An important question that a developer needs to consider is whether or not drag and drop is appropriate for a
particular application. You need to think about the data that is manipulated by the application, the actions that can be
performed on the data, and whether the drag and drop metaphor makes sense in this context. This decision involves
figuring out if drag and drop allows you to enhance the usability of your application by making it easier for the user to
perform various tasks.
For example, an electronic mail application might allow the user to drag messages that have been received into folders
for storage or into a text editor for composing a response. Perhaps the most common use of drag and drop
functionality is for desktop−style applications. These programs allow the user to manipulate files in the directory
structure and run other applications by dragging objects around ...