:right-sidebar: True DropControllerMotion =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: DropControllerMotion(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.EventController`, :class:`~gi.repository.GObject.Object` ``GtkDropControllerMotion`` is an event controller tracking the pointer during Drag-and-Drop operations. It is modeled after :obj:`~gi.repository.Gtk.EventControllerMotion` so if you have used that, this should feel really familiar. This controller is not able to accept drops, use :obj:`~gi.repository.Gtk.DropTarget` for that purpose. Constructors ------------ .. rst-class:: interim-class .. class:: DropControllerMotion :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.EventController Creates a new event controller that will handle pointer motion events during drag and drop. Methods ------- .. rst-class:: interim-class .. class:: DropControllerMotion :no-index: .. method:: contains_pointer() -> bool Returns if a Drag-and-Drop operation is within the widget ``self`` or one of its children. .. method:: get_drop() -> ~gi.repository.Gdk.Drop | None Returns the ``GdkDrop`` of a current Drag-and-Drop operation over the widget of ``self``. .. method:: is_pointer() -> bool Returns if a Drag-and-Drop operation is within the widget ``self``, not one of its children. Properties ---------- .. rst-class:: interim-class .. class:: DropControllerMotion :no-index: .. attribute:: props.contains_pointer :type: bool Whether the pointer of a Drag-and-Drop operation is in the controller's widget or a descendant. See also :obj:`~gi.repository.Gtk.DropControllerMotion.props.is_pointer`. When handling crossing events, this property is updated before :obj:`~gi.repository.Gtk.DropControllerMotion.signals.enter`, but after :obj:`~gi.repository.Gtk.DropControllerMotion.signals.leave` is emitted. .. attribute:: props.drop :type: ~gi.repository.Gdk.Drop The ongoing drop operation over the controller's widget or its descendant. If no drop operation is going on, this property returns :const:`None`. The event controller should not modify the ``drop``, but it might want to query its properties. When handling crossing events, this property is updated before :obj:`~gi.repository.Gtk.DropControllerMotion.signals.enter`, but after :obj:`~gi.repository.Gtk.DropControllerMotion.signals.leave` is emitted. .. attribute:: props.is_pointer :type: bool Whether the pointer is in the controllers widget itself, as opposed to in a descendent widget. See also :obj:`~gi.repository.Gtk.DropControllerMotion.props.contains_pointer`. When handling crossing events, this property is updated before :obj:`~gi.repository.Gtk.DropControllerMotion.signals.enter`, but after :obj:`~gi.repository.Gtk.DropControllerMotion.signals.leave` is emitted. Signals ------- .. rst-class:: interim-class .. class:: DropControllerMotion.signals :no-index: .. method:: enter(x: float, y: float) -> None Signals that the pointer has entered the widget. :param x: coordinates of pointer location :param y: coordinates of pointer location .. method:: leave() -> None Signals that the pointer has left the widget. .. method:: motion(x: float, y: float) -> None Emitted when the pointer moves inside the widget. :param x: the x coordinate :param y: the y coordinate