Drag and Drop

Moving information via Drag and Drop (DND) is a capability supported in most modern user interfaces. The user clicks on a source with the mouse, then drags to a destination. An icon is displayed to give feedback to the user. GTK+ provides a set of interfaces for supporting drag and drop that are both easy to use and highly customizable. By writing to these interfaces, the appliciation can interoperate with programs supporting either the Motif or Xdnd Drag and Drop protocols.

The GTK+ interfaces are separated into two parts, on both the source and destination sides. There is a low-level interface that allows for detailed customization of the drag-and-drop behavior, and then a high-level, simple interface that allows the most common types of drag and drop to be accomplished with very little code.

Internally, GTK+ supports both the new Xdnd drag and drop protocol, which is rapidly gaining support, and the Motif drag and drop protocol. This is mostly transparent to the application programmer - so without special effort, they gain interoperability with both toolkits and thereby with applications now supporting Xdnd, such as Qt and Star Office, and with the large installed base of Motif applications.

The Xdnd protocol specifies that the data types for transferred data are negotiated as MIME types. This convention has been adopted throughout GNOME.

Articles

Reference (GTK+ Reference Documentation Project)

Users · Developers · ViewCVS · FTP · Bugzilla · Software Map · Contact