Gtk.DropControllerMotion

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

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

class

new ()

contains_pointer ()

get_drop ()

is_pointer ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Gtk.EventController (4)

Name

Type

Flags

Short Description

contains-pointer

bool

r

drop

Gdk.Drop

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.DropControllerMotion(**kwargs)
Bases:

Gtk.EventController

Abstract:

No

Structure:

Gtk.DropControllerMotionClass

GtkDropControllerMotion is an event controller tracking the pointer during Drag-and-Drop operations.

It is modeled after [class`Gtk`.EventControllerMotion] so if you have used that, this should feel really familiar.

This controller is not able to accept drops, use [class`Gtk`.DropTarget] for that purpose.

classmethod new()[source]
Returns:

a new GtkDropControllerMotion

Return type:

Gtk.EventController

Creates a new event controller that will handle pointer motion events during drag and drop.

contains_pointer()[source]
Returns:

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

Return type:

bool

Returns if a Drag-and-Drop operation is within the widget self or one of its children.

get_drop()[source]
Returns:

The GdkDrop currently happening within self

Return type:

Gdk.Drop or None

Returns the GdkDrop of a current Drag-and-Drop operation over the widget of self.

is_pointer()[source]
Returns:

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

Return type:

bool

Returns if a Drag-and-Drop operation is within the widget self, not one of its children.

Signal Details

Gtk.DropControllerMotion.signals.enter(drop_controller_motion, x, y)
Signal Name:

enter

Flags:

RUN_LAST

Parameters:
  • drop_controller_motion (Gtk.DropControllerMotion) – 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.DropControllerMotion.signals.leave(drop_controller_motion)
Signal Name:

leave

Flags:

RUN_LAST

Parameters:

drop_controller_motion (Gtk.DropControllerMotion) – The object which received the signal

Signals that the pointer has left the widget.

Gtk.DropControllerMotion.signals.motion(drop_controller_motion, x, y)
Signal Name:

motion

Flags:

RUN_FIRST

Parameters:

Emitted when the pointer moves inside the widget.

Property Details

Gtk.DropControllerMotion.props.contains_pointer
Name:

contains-pointer

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the pointer of a Drag-and-Drop operation is in the controller’s widget or a descendant.

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

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

Gtk.DropControllerMotion.props.drop
Name:

drop

Type:

Gdk.Drop

Default Value:

None

Flags:

READABLE

The ongoing drop operation over the controller’s widget or its descendant.

If no drop operation is going on, this property returns 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 [signal`Gtk`.DropControllerMotion::enter], but after [signal`Gtk`.DropControllerMotion::leave] is emitted.

Gtk.DropControllerMotion.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`.DropControllerMotion:contains-pointer].

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