:right-sidebar: True EventControllerMotion =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: EventControllerMotion(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.EventController`, :class:`~gi.repository.GObject.Object` ``GtkEventControllerMotion`` is an event controller tracking the pointer position. The event controller offers :obj:`~gi.repository.Gtk.EventControllerMotion.signals.enter` and :obj:`~gi.repository.Gtk.EventControllerMotion.signals.leave` signals, as well as :obj:`~gi.repository.Gtk.EventControllerMotion.props.is_pointer` and :obj:`~gi.repository.Gtk.EventControllerMotion.props.contains_pointer` properties which are updated to reflect changes in the pointer position as it moves over the widget. Constructors ------------ .. rst-class:: interim-class .. class:: EventControllerMotion :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.EventController Creates a new event controller that will handle motion events. Methods ------- .. rst-class:: interim-class .. class:: EventControllerMotion :no-index: .. method:: contains_pointer() -> bool Returns if a pointer is within ``self`` or one of its children. .. method:: is_pointer() -> bool Returns if a pointer is within ``self``, but not one of its children. Properties ---------- .. rst-class:: interim-class .. class:: EventControllerMotion :no-index: .. attribute:: props.contains_pointer :type: bool Whether the pointer is in the controllers widget or a descendant. See also :obj:`~gi.repository.Gtk.EventControllerMotion.props.is_pointer`. When handling crossing events, this property is updated before :obj:`~gi.repository.Gtk.EventControllerMotion.signals.enter`, but after :obj:`~gi.repository.Gtk.EventControllerMotion.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.EventControllerMotion.props.contains_pointer`. When handling crossing events, this property is updated before :obj:`~gi.repository.Gtk.EventControllerMotion.signals.enter`, but after :obj:`~gi.repository.Gtk.EventControllerMotion.signals.leave` is emitted. Signals ------- .. rst-class:: interim-class .. class:: EventControllerMotion.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