Drag and Drop

Functions for controlling drag and drop handling

Methods and Functions

gtkDragDestSet(object, flags, targets, actions) gtkDragDestSetProxy(object, proxy.window, protocol, use.coordinates) gtkDragDestUnset(object) gtkDragDestFindTarget(object, context, target.list) gtkDragDestGetTargetList(object) gtkDragDestSetTargetList(object, target.list) gtkDragDestAddTextTargets(object) gtkDragDestAddImageTargets(object) gtkDragDestAddUriTargets(object) gtkDragDestSetTrackMotion(object, track.motion) gtkDragDestGetTrackMotion(object) gtkDragFinish(object, success, del, time = "GDK_CURRENT_TIME") gtkDragGetData(object, context, target, time = "GDK_CURRENT_TIME") gtkDragGetSourceWidget(context) gtkDragHighlight(object) gtkDragUnhighlight(object) gtkDragBegin(object, targets, actions, button, event) gtkDragSetIconWidget(object, widget, hot.x, hot.y) gtkDragSetIconPixmap(object, colormap, pixmap, mask, hot.x, hot.y) gtkDragSetIconPixbuf(object, pixbuf, hot.x, hot.y) gtkDragSetIconStock(object,, hot.x, hot.y) gtkDragSetIconName(object,, hot.x, hot.y) gtkDragSetIconDefault(object) gtkDragSetDefaultIcon(colormap, pixmap, mask, hot.x, hot.y) gtkDragCheckThreshold(object, start.x, start.y, current.x, current.y) gtkDragSourceSet(object, start.button.mask, targets, actions) gtkDragSourceSetIcon(object, colormap, pixmap, mask = NULL) gtkDragSourceSetIconPixbuf(object, pixbuf) gtkDragSourceSetIconStock(object, gtkDragSourceSetIconName(widget, gtkDragSourceUnset(object) gtkDragSourceSetTargetList(object, target.list) gtkDragSourceGetTargetList(object) gtkDragSourceAddTextTargets(object) gtkDragSourceAddImageTargets(object) gtkDragSourceAddUriTargets(object)

Detailed Description

GTK+ has a rich set of functions for doing inter-process communication via the drag-and-drop metaphor. GTK+ can do drag-and-drop (DND) via multiple protocols. The currently supported protocols are the Xdnd and Motif protocols. As well as the functions listed here, applications may need to use some facilities provided for Selections. Also, the Drag and Drop API makes use of signals in the GtkWidget class.

Enums and Flags

The GtkDestDefaults enumeration specifies the various types of action that will be taken on behalf of the user for a drag destination site.
If set for a widget, GTK+, during a drag over this widget will check if the drag matches this widget's list of possible targets and actions. GTK+ will then call gdkDragStatus as appropriate.
If set for a widget, GTK+ will draw a highlight on this widget as long as a drag is over this widget and the widget drag format and action are acceptable.
If set for a widget, when a drop occurs, GTK+ will will check if the drag matches this widget's list of possible targets and actions. If so, GTK+ will call gtkDragGetData on behalf of the widget. Whether or not the drop is successful, GTK+ will call gtkDragFinish. If the action was a move, then if the drag was successful, then TRUE will be passed for the delete parameter to gtkDragFinish.
If set, specifies that all default actions should be taken.
The GtkTargetFlags enumeration is used to specify constraints on an entry in a GtkTargetTable.
If this is set, the target will only be selected for drags within a single application.
If this is set, the target will only be selected for drags within a single widget.


  • gtk-Drag-and-Drop
  • GtkDestDefaults
  • GtkTargetFlags
Documentation reproduced from package RGtk2, version 2.20.31, License: GPL

Community examples

Looks like there are no examples yet.