Creates a new gtk.drop_target.DropTarget object.
Connect to Accept signal.
Connect to Drop signal.
Connect to Enter signal.
Connect to Leave signal.
Connect to Motion signal.
Gets the actions that this drop target supports.
Gets the currently handled drop operation.
Gets the currently handled drop operation.
Gets the data formats that this drop target accepts.
Gets the list of supported gobject.types.TYPE_FLAG_RESERVED_ID_BITs that can be dropped on the target.
Gets whether data should be preloaded on hover.
Gets the current drop data, as a gobject.value.Value.
Rejects the ongoing drop operation.
Sets the actions that this drop target supports.
Sets the supported gobject.types.TYPE_FLAG_RESERVED_ID_BITs for this drop target.
Sets whether data should be preloaded on hover.
Returns the event that is currently being handled by the controller.
Returns the device of the event that is currently being handled by the controller.
Returns the modifier state of the event that is currently being handled by the controller.
Returns the timestamp of the event that is currently being handled by the controller.
Gets the name of controller.
Gets the propagation limit of the event controller.
Gets the propagation phase at which controller handles events.
Returns the gtk.widget.Widget this controller relates to.
Resets the controller to a clean state.
Sets a name on the controller that can be used for debugging.
Sets the event propagation limit on the event controller.
Sets the propagation phase at which a controller handles events.
Sets a name on the controller that can be used for debugging.
gtk.drop_target.DropTarget is an event controller to receive Drag-and-Drop operations.
The most basic way to use a gtk.drop_target.DropTarget to receive drops on a widget is to create it via gtk.drop_target.DropTarget.new_, passing in the gobject.types.TYPE_FLAG_RESERVED_ID_BIT of the data you want to receive and connect to the gtk.drop_target.DropTarget.drop signal to receive the data:
gtk.drop_target.DropTarget supports more options, such as:
However, gtk.drop_target.DropTarget is ultimately modeled in a synchronous way and only supports data transferred via gobject.types.TYPE_FLAG_RESERVED_ID_BIT. If you want full control over an ongoing drop, the gtk.drop_target_async.DropTargetAsync object gives you this ability.
While a pointer is dragged over the drop target's widget and the drop has not been rejected, that widget will receive the gtk.types.StateFlags.DropActive state, which can be used to style the widget.
If you are not interested in receiving the drop, but just want to update UI state during a Drag-and-Drop operation (e.g. switching tabs), you can use gtk.drop_controller_motion.DropControllerMotion.