DragIcon#
Superclasses: Widget, InitiallyUnowned, Object
Implemented Interfaces: Accessible, Buildable, ConstraintTarget, Native, Root
GtkDragIcon is 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 get_for_drag to get the icon for a drag. You can
then use it like any other widget and use set_child
to set whatever widget should be used for the drag icon.
Keep in mind that drag icons do not allow user input.
Constructors#
Methods#
- class DragIcon
- classmethod create_widget_for_value() Widget | None#
Creates a widget that can be used as a drag icon for the given
value.Supported types include strings,
GdkRGBAandGtkTextBuffer. If GTK does not know how to create a widget for a given value, it will returnNone.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.
- set_child(child: Widget | None = None) None#
Sets the widget to display as the drag icon.
- Parameters:
child – a
GtkWidget
- classmethod set_from_paintable(paintable: Paintable, hot_x: int, hot_y: int) None#
Creates a
GtkDragIconthat showspaintable, and associates it with the drag operation.The hotspot position on the paintable is aligned with the hotspot of the cursor.
- Parameters:
paintable – a
GdkPaintableto displayhot_x – X coordinate of the hotspot
hot_y – Y coordinate of the hotspot