Gdk.Drag.begin
Description: Reference for Gdk.Drag.begin

### Function

# Gdk Dragbegin

#### 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`

  Type: `GdkSurface`

  The source surface for this drag.

  The data is owned by the caller of the function.

`device`

  Type: `GdkDevice`

  The device that controls this drag.

  The data is owned by the caller of the function.

`content`

  Type: `GdkContentProvider`

  The offered content.

  The data is owned by the caller of the function.

`actions`

  Type: `GdkDragAction`

  The actions supported by this drag.

`dx`

  Type: `double`

  The x offset to `device`‘s position where the drag nominally started.

`dy`

  Type: `double`

  The y offset to `device`‘s position where the drag nominally started.

#### Return value

Type: `GdkDrag`

A newly created `GdkDrag`

The caller of the function takes ownership of the data, and is responsible for freeing it.
The return value can be `NULL`.