Drag.begin

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.Drag.getDragSurface].

This function returns a reference to the [gdk.drag.Drag] object, but GTK keeps its own reference as well, as long as the DND operation is going on.

Note

if actions include [gdk.types.DragAction.Move], you need to listen for

the signalGdk.Drag::dnd-finished signal and delete the data at the source if [gdk.drag.Drag.getSelectedAction] returns [gdk.types.DragAction.Move].

Parameters

surfacethe source surface for this drag
devicethe device that controls this drag
contentthe offered content
actionsthe actions supported by this drag
dxthe x offset to device's position where the drag nominally started
dythe y offset to device's position where the drag nominally started

Returns

a newly created [gdk.drag.Drag]