22.2. DND Properties

Drag data has the following properties:

Drag actions are quite obvious, they specify if the widget can drag with the specified action(s), e.g. gtk.gdk.ACTION_COPY and/or gtk.gdk.ACTION_MOVE. An gtk.gdk.ACTION_COPY would be a typical drag-and-drop without the source data being deleted while gtk.gdk.ACTION_MOVE would be just like gtk.gdk.ACTION_COPY but the source data will be 'suggested' to be deleted after the received signal handler is called. There are additional drag actions including gtk.gdk.ACTION_LINK which you may want to look into when you get to more advanced levels of drag-and-drop.

The client specified arbitrary drag-and-drop type is much more flexible, because your application will be defining and checking for that specifically. You will need to set up your destination widgets to receive certain drag-and-drop types by specifying a name and/or number. It would be more reliable to use a name since another application may just happen to use the same number for an entirely different meaning.

Sent and received data format types (selection target) come into play only in your request and received data handler functions. The term selection target is somewhat misleading. It is a term adapted from GTK+ selection (cut/copy and paste). What selection target actually means is the data's format type (i.e. gtk.gdk.Atom, integer, or string) that is being sent or received. Your request data handler function needs to specify the type (selection target) of data that it sends out and your received data handler needs to handle the type (selection target) of data received.