DragIcon

class DragIcon(**properties: Any)

Superclasses: Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Buildable, ConstraintTarget, Native, Root

Constructors:

DragIcon(**properties)

Methods

class DragIcon
create_widget_for_value(value: Any) Widget | None

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 None.

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.

Parameters:

value – a GValue

get_child() Widget | None

Gets the widget currently used as drag icon.

get_for_drag(drag: Drag) Widget

Gets the GtkDragIcon in use with drag.

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

Parameters:

drag – a GdkDrag

set_child(child: Widget | None = None) None

Sets the widget to display as the drag icon.

Parameters:

child – a GtkWidget

set_from_paintable(drag: Drag, paintable: Paintable, hot_x: int, hot_y: int) None

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

Properties

class DragIcon
props.child: Widget

The widget to display as drag icon.