EventControllerMotion

class EventControllerMotion(**properties: Any)

Superclasses: EventController, Object

GtkEventControllerMotion is an event controller tracking the pointer position.

The event controller offers enter and leave signals, as well as is_pointer and contains_pointer properties which are updated to reflect changes in the pointer position as it moves over the widget.

Constructors

class EventControllerMotion
classmethod new() EventController

Creates a new event controller that will handle motion events.

Methods

class EventControllerMotion
contains_pointer() bool

Returns if a pointer is within self or one of its children.

is_pointer() bool

Returns if a pointer is within self, but not one of its children.

Properties

class EventControllerMotion
props.contains_pointer: bool

Whether the pointer is in the controllers widget or a descendant.

See also is_pointer.

When handling crossing events, this property is updated before enter, but after leave is emitted.

props.is_pointer: bool

Whether the pointer is in the controllers widget itself, as opposed to in a descendent widget.

See also contains_pointer.

When handling crossing events, this property is updated before enter, but after leave is emitted.

Signals

class EventControllerMotion.signals
enter(x: float, y: float) None

Signals that the pointer has entered the widget.

Parameters:
  • x – coordinates of pointer location

  • y – coordinates of pointer location

leave() None

Signals that the pointer has left the widget.

motion(x: float, y: float) None

Emitted when the pointer moves inside the widget.

Parameters:
  • x – the x coordinate

  • y – the y coordinate