Package: gdk

Function gdk:drag-begin

Lambda List

gdk:drag-begin (surface device content actions dx dy)

Arguments

surface -- a gdk:surface object for this drag object
device -- a gdk:device object that controls the drag object
content -- a gdk:content-provider object for the offered content
actions -- a gdk:drag-action value for the actions supported by this drag object
dx -- a number coerced to a double float for the x offset to the position of the device where the drag nominally started
dy -- a number coerced to a double float for the y offset to the position of the device where the drag nominally started

Return Value

The newly created gdk:drag object or nil on error.

Details

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 the gdk:drag-drag-surface function.

This function returns a reference to the gdk:drag object, but GTK keeps its own reference as well, as long as the drag and drop operation is going on.

Note: If actions include :move, you need to listen for the "dnd-finished" signal and delete the data at the source if the gdk:drag-selected-action function returns :move.
 

See also

2026-08-09