Creates a new gtk.drag_source.DragSource object.
Connect to DragBegin signal.
Connect to DragCancel signal.
Connect to DragEnd signal.
Connect to Prepare signal.
Cancels a currently ongoing drag operation.
Gets the actions that are currently set on the gtk.drag_source.DragSource.
Gets the current content provider of a gtk.drag_source.DragSource.
Returns the underlying gdk.drag.Drag object for an ongoing drag.
Sets the actions on the gtk.drag_source.DragSource.
Sets a content provider on a gtk.drag_source.DragSource.
Sets a paintable to use as icon during DND operations.
Returns the button number gesture listens for.
Returns the button number currently interacting with gesture, or 0 if there is none.
Returns the event sequence currently interacting with gesture.
Gets whether a gesture is exclusive.
Returns true if the gesture is only triggered by touch events.
Sets the button number gesture listens to.
Sets whether gesture is exclusive.
Sets whether to handle only touch events.
gtk.drag_source.DragSource is an event controller to initiate Drag-And-Drop operations.
gtk.drag_source.DragSource can be set up with the necessary ingredients for a DND operation ahead of time. This includes the source for the data that is being transferred, in the form of a gdk.content_provider.ContentProvider, the desired action, and the icon to use during the drag operation. After setting it up, the drag source must be added to a widget as an event controller, using gtk.widget.Widget.addController.
Setting up the content provider and icon ahead of time only makes sense when the data does not change. More commonly, you will want to set them up just in time. To do so, gtk.drag_source.DragSource has gtk.drag_source.DragSource.prepare and signal@Gtk.DragSource::drag-begin signals.
The ::prepare signal is emitted before a drag is started, and can be used to set the content provider and actions that the drag should be started with.
The ::drag-begin signal is emitted after the gdk.drag.Drag object has been created, and can be used to set up the drag icon.
During the DND operation, gtk.drag_source.DragSource emits signals that can be used to obtain updates about the status of the operation, but it is not normally necessary to connect to any signals, except for one case: when the supported actions include gdk.types.DragAction.Move, you need to listen for the signal@Gtk.DragSource::drag-end signal and delete the data after it has been transferred.