1.46 <GtkDragIcon>

Class: <GtkDragIcon>

It derives from <GtkWidget>.

A <GtkRoot> implementation for drag icons.

A drag icon moves with the pointer during a Drag-and-Drop operation and is destroyed when the drag ends.

To set up a drag icon and associate it with an ongoing drag operation, use drag-icon:get-for-drag to get the icon for a drag. You can then use it like any other widget and use 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.

Properties

Property: drag-icon:child self

The widget to display as drag icon.

Its value is a <GtkWidget>, or #f.

Set it with (set! (drag-icon:child self) value).

Procedures

Procedure: drag-icon:create-widget-for-value value ⇒ %return

Creates a widget that can be used as a drag icon for the given value.

Supported types include strings, <GdkRGBA> and <GtkTextBuffer>. If GTK does not know how to create a widget for a given value, it will return #f.

This method is used to set the default drag icon on drag-and-drop operations started by <GtkDragSource>, so you don’t need to set a drag icon using this function there.

value

Passed: a <GValue>.

a <GValue>

%return

Returned: a <GtkWidget>, or #f.

A new <GtkWidget> for displaying value as a drag icon.

Method: drag-icon:get-child self ⇒ %return
Method: get-child self ⇒ %return

Gets the widget currently used as drag icon.

self

Passed: a <GtkDragIcon>.

a <GtkDragIcon>

%return

Returned: a <GtkWidget>, or #f.

The drag icon

Procedure: drag-icon:get-for-drag drag ⇒ %return

Gets the <GtkDragIcon> in use with drag.

If no drag icon exists yet, a new one will be created and shown.

drag

Passed: a <GdkDrag>.

a <GdkDrag>

%return

Returned: a <GtkWidget>.

the <GtkDragIcon>

Method: drag-icon:set-child self [child]
Method: set-child self [child]

Sets the widget to display as the drag icon.

self

Passed: a <GtkDragIcon>.

a <GtkDragIcon>

child

Passed, or left out: a <GtkWidget>, or #f.

a <GtkWidget>

Procedure: drag-icon:set-from-paintable drag paintable hot-x 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.

drag

Passed: a <GdkDrag>.

a <GdkDrag>

paintable

Passed: a <GdkPaintable>.

a <GdkPaintable> to display

hot-x

Passed: a 32-bit integer.

X coordinate of the hotspot

hot-y

Passed: a 32-bit integer.

Y coordinate of the hotspot