Gtk.EventControllerMotion

g GObject.Object GObject.Object Gtk.EventController Gtk.EventController GObject.Object->Gtk.EventController Gtk.EventControllerMotion Gtk.EventControllerMotion Gtk.EventController->Gtk.EventControllerMotion

Subclasses:

None

Methods

Inherited:

Gtk.EventController (13), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

contains_pointer ()

is_pointer ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Gtk.EventController (4)

Name

Type

Flags

Short Description

contains-pointer

bool

r

is-pointer

bool

r

Signals

Inherited:

GObject.Object (1)

Name

Short Description

enter

Signals that the pointer has entered the widget.

leave

Signals that the pointer has left the widget.

motion

Emitted when the pointer moves inside the widget.

Fields

Inherited:

GObject.Object (1)

Class Details

class Gtk.EventControllerMotion(**kwargs)
Bases:

Gtk.EventController

Abstract:

No

Structure:

Gtk.EventControllerMotionClass

GtkEventControllerMotion is an event controller tracking the pointer position.

The event controller offers [signal`Gtk`.EventControllerMotion::enter] and [signal`Gtk`.EventControllerMotion::leave] signals, as well as [property`Gtk`.EventControllerMotion:is-pointer] and [property`Gtk`.EventControllerMotion:contains-pointer] properties which are updated to reflect changes in the pointer position as it moves over the widget.

classmethod new()[source]
Returns:

a new GtkEventControllerMotion

Return type:

Gtk.EventController

Creates a new event controller that will handle motion events.

contains_pointer()[source]
Returns:

True if a pointer is within self or one of its children

Return type:

bool

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

is_pointer()[source]
Returns:

True if a pointer is within self but not one of its children

Return type:

bool

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

Signal Details

Gtk.EventControllerMotion.signals.enter(event_controller_motion, x, y)
Signal Name:

enter

Flags:

RUN_LAST

Parameters:
  • event_controller_motion (Gtk.EventControllerMotion) – The object which received the signal

  • x (float) – coordinates of pointer location

  • y (float) – coordinates of pointer location

Signals that the pointer has entered the widget.

Gtk.EventControllerMotion.signals.leave(event_controller_motion)
Signal Name:

leave

Flags:

RUN_LAST

Parameters:

event_controller_motion (Gtk.EventControllerMotion) – The object which received the signal

Signals that the pointer has left the widget.

Gtk.EventControllerMotion.signals.motion(event_controller_motion, x, y)
Signal Name:

motion

Flags:

RUN_FIRST

Parameters:

Emitted when the pointer moves inside the widget.

Property Details

Gtk.EventControllerMotion.props.contains_pointer
Name:

contains-pointer

Type:

bool

Default Value:

False

Flags:

READABLE

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

See also [property`Gtk`.EventControllerMotion:is-pointer].

When handling crossing events, this property is updated before [signal`Gtk`.EventControllerMotion::enter], but after [signal`Gtk`.EventControllerMotion::leave] is emitted.

Gtk.EventControllerMotion.props.is_pointer
Name:

is-pointer

Type:

bool

Default Value:

False

Flags:

READABLE

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

See also [property`Gtk`.EventControllerMotion:contains-pointer].

When handling crossing events, this property is updated before [signal`Gtk`.EventControllerMotion::enter], but after [signal`Gtk`.EventControllerMotion::leave] is emitted.