GtkDragIcon — A toplevel to use as drag icon
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkDragIcon
GtkDragIcon is a GtkRoot 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_get_for_drag() to get the icon for a drag. You can then use it like any other widget and use
gtk_drag_icon_set_child() to set whatever widget should be used for the drag icon.
Keep in mind that drag icons do not allow user input.
Gets the GtkDragIcon in use with
If no drag icon exists yet, a new one will be created and shown.
void gtk_drag_icon_set_child (
Sets the widget to display as the drag icon.
GtkWidget * gtk_drag_icon_get_child (
Gets the widget currently used as drag icon.
The drag icon or
NULL if none.
void gtk_drag_icon_set_from_paintable (
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.
GtkWidget * gtk_drag_icon_create_widget_for_value (
const GValue *value);
Creates a widget that can be used as a drag icon for the given
This method is used to set the default drag icon on drag'n'drop operations started by GtkDragSource, so you don't need to set a drag icon using this function there.
A new GtkWidget for displaying
value as a drag icon.
typedef struct _GtkDragIcon GtkDragIcon;
“child” GtkWidget *
The widget to display as drag icon.
Flags: Read / Write
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.