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