19.2 The Drag and Drop Model
The Motif implementation of drag and drop introduces a number of new programming constructs. The interaction
between the different components is complex, so it may be difficult to understand just what needs to be done to
implement drag and drop functionality. Since you need to understand all of the different components before you can
see what your application may need, we've decided to describe all of the components of drag and drop in a somewhat
abstract way before we present any examples. Although this material may be a bit dry, we think that this approach
works better than presenting an example early and then having to jump around a lot to explain all of its parts.
Hopefully, once you see the big picture, it will be easier to understand the different pieces more fully.
From the programmer's perspective, providing drag and drop functionality in an application can be as simple as using
the Motif widgets that support drag and drop. In Motif 1.2, the Text, TextField, and List widgets are all drag sources,
which means that the textual data they contain can be dragged. The Label widget and its subclasses are also drag
sources for both textual and pixmap data. The Text and TextField widgets are registered as drop sites, which means
that textual data can be dropped in them. When you use these widgets in an application, you do not have to do any
extra programming to provide their drag and drop capabilities since the functionality is built into the widgets.
The drag ...