Chapter 15. Drag and Drop

Table of Contents

Sources and Destinations
Methods
Signals
Copy
Move
Link
DragContext
Example

Gtk::Widget has several methods and signals which are prefixed with "drag_". These are used for Drag and Drop.

Sources and Destinations

Things are dragged from sources to be dropped on destinations. Each source and destination has infomation about the data formats that it can send or receive, provided by Gtk::TargetEntry items. A drop destination will only accept a dragged item if they both share a compatible Gtk::TargetEntry item. Appropriate signals will then be emitted, telling the signal handlers which Gtk::TargetEntry was used.

Gtk::TargetEntry objects contain this information:


Google

  • target: A name, such as "STRING"

  • info: An identifier which will be sent to your signals to tell you which TargetEntry was used.

  • flags: TODO