Versions of PyGObject < 3.0.3 contain a bug which does not allow drag
and drop to function correctly. Therefore a version of PyGObject >= 3.0.3 is
required for the following examples to work.

Setting up drag and drop between widgets consists of selecting a drag source
(the widget which the user starts the drag from) with the
Gtk.Widget.drag_source_set() method, selecting a drag destination (the
widget which the user drops onto) with the Gtk.Widget.drag_dest_set()
method and then handling the relevant signals on both widgets.

A basic drag and drop only requires the source to connect to the “drag-data-get”
signal and the destination to connect to the “drag-data-received” signal. More
complex things such as specific drop areas and custom drag icons will require
you to connect to additional signals and interact with
the Gdk.DragContext object it supplies.

To allow the drag source and destination to know what data they are receiving and
sending, a common list of Gtk.TargetEntry's are required.
A Gtk.TargetEntry describes a piece of data that will be sent by the drag
source and received by the drag destination.

There are two ways of adding Gtk.TargetEntry's to a
source and destination. If the drag and drop is simple and each target entry is
of a different type, you can use the group of methods mentionedhere.