Drag data has the following properties:
Drag actions are quite obvious, they specify if the widget can drag with the specified actions, e.g. Gdk::ACTION_COPY and/or Gdk::ACTION_MOVE. A Gdk::ACTION_COPY would be a typical drag-and-drop without the source data being deleted while Gdk::ACTION_MOVE would be just like 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 Gdk::ACTION_LINK which you may want to look into when you get to more advanced levels of drag-and-drop. Please refer to the Ruby-GNOME2 API documentation for further details.
The client specified arbitrary drag-and-drop type is more flexibale, 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 formats (selection target) come into play only in your request and received data handler methods. The term selection target is somewhat misleading. It is a term adpated from GTK+ selection (cut/copy/paste). What selection target actually means is the data's format type that is being sent or received. Your request data handler method needs to specify the type (selection target) of data that it sends out and your received data signal method needs to handle the type of data received.
Prev | Next |