GtkDragIcon

GtkDragIcon — A toplevel to use as drag icon

Functions

Types and Values

  GtkDragIcon

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkDragIcon

Implemented Interfaces

GtkDragIcon implements AtkImplementorIface, GtkBuildable, GtkConstraintTarget, GtkNative and GtkRoot.

Includes

#include <gtk/gtk.h>

Description

GtkDragIcon is a GtkNative implementation with the sole purpose to serve as a drag icon during DND operations. A drag icon moves with the pointer during a drag operation and is destroyed when the drag ends.

To set up a drag icon and associate it with an ongoing drag operation, use gtk_drag_icon_set_from_paintable(). It is also possible to create a GtkDragIcon with gtk_drag_icon_new_for_drag(() and populate it with widgets yourself.

Functions

gtk_drag_icon_new_for_drag ()

GtkWidget *
gtk_drag_icon_new_for_drag (GdkDrag *drag);

Creates a GtkDragIcon and associates it with the drag operation.

Parameters

drag

a GtkDrag

 

Returns

the new GtkDragIcon


gtk_drag_icon_set_from_paintable ()

void
gtk_drag_icon_set_from_paintable (GdkDrag *drag,
                                  GdkPaintable *paintable,
                                  int hot_x,
                                  int hot_y);

Creates a GtkDragIcon that shows paintable , and associates it with the drag operation. The hotspot position on the paintable is aligned with the hotspot of the cursor.

Parameters

drag

a GdkDrag

 

paintable

a GdkPaintable to display

 

hot_x

X coordinate of the hotspot

 

hot_y

Y coordinate of the hotspot