Gtk.DragIcon¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Native (6), Gtk.Root (3)
- Structs:
class |
|
class |
|
class |
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.DragIcon(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GtkDragIcon
is aGtkRoot
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 [func`Gtk`.DragIcon.get_for_drag] to get the icon for a drag. You can then use it like any other widget and use [method`Gtk`.DragIcon.set_child] to set whatever widget should be used for the drag icon.
Keep in mind that drag icons do not allow user input.
- classmethod create_widget_for_value(value)[source]¶
- Parameters:
value (
GObject.Value
) – aGValue
- Returns:
A new
GtkWidget
for displaying value as a drag icon.- Return type:
Gtk.Widget
orNone
Creates a widget that can be used as a drag icon for the given value.
Supported types include strings,
GdkRGBA
andGtkTextBuffer
. 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.
- classmethod get_for_drag(drag)[source]¶
- Parameters:
drag (
Gdk.Drag
) – aGdkDrag
- Returns:
the
GtkDragIcon
- Return type:
Gets the
GtkDragIcon
in use with drag.If no drag icon exists yet, a new one will be created and shown.
- classmethod set_from_paintable(drag, paintable, hot_x, hot_y)[source]¶
- Parameters:
drag (
Gdk.Drag
) – aGdkDrag
paintable (
Gdk.Paintable
) – aGdkPaintable
to displayhot_x (
int
) – X coordinate of the hotspothot_y (
int
) – Y coordinate of the hotspot
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.
- get_child()[source]¶
- Returns:
The drag icon
- Return type:
Gtk.Widget
orNone
Gets the widget currently used as drag icon.
- set_child(child)[source]¶
- Parameters:
child (
Gtk.Widget
orNone
) – aGtkWidget
Sets the widget to display as the drag icon.
Property Details¶
- Gtk.DragIcon.props.child¶
- Name:
child
- Type:
- Default Value:
- Flags:
The widget to display as drag icon.