Function

Gdk.Drag.begin

Declaration [src]

GdkDrag*
gdk_drag_begin (
  GdkSurface* surface,
  GdkDevice* device,
  GdkContentProvider* content,
  GdkDragAction actions,
  double dx,
  double dy
)

Description [src]

Starts a drag and creates a new drag context for it.

This function is called by the drag source. After this call, you probably want to set up the drag icon using the surface returned by gdk_drag_get_drag_surface().

This function returns a reference to the GdkDrag object, but GTK keeps its own reference as well, as long as the DND operation is going on.

Note: if actions include GDK_ACTION_MOVE, you need to listen for the GdkDrag::dnd-finished signal and delete the data at the source if gdk_drag_get_selected_action() returns GDK_ACTION_MOVE.

Parameters

surface GdkSurface
 

the source surface for this drag

 Ownership is not transferred to the callee
device GdkDevice
 

the device that controls this drag

 Ownership is not transferred to the callee
content GdkContentProvider
 

the offered content

 Ownership is not transferred to the callee
actions GdkDragAction
 

the actions supported by this drag

dx double
 

the x offset to devices position where the drag nominally started

dy double
 

the y offset to devices position where the drag nominally started

Return value

Returns: GdkDrag

a newly created GdkDrag or NULL on error

Ownership of the data is transferred to the caller
Can be NULL