About all my projects
Gnome::Gtk4::DropControllerMotion

Gnome::Gtk4::DropControllerMotion

Description

Gnome::Gtk4::DropControllerMotion is an event controller tracking the pointer during Drag-and-Drop operations.

It is modeled after Gnome::Gtk4::EventControllerMotion so if you have used that, this should feel really familiar.

This controller is not able to accept drops, use Gnome::Gtk4::DropTarget for that purpose.

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

new-dropcontrollermotion

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

method new-dropcontrollermotion ( --> Gnome::Gtk4::DropControllerMotion \)

Methods

contains-pointer

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

method contains-pointer (--> Bool )

Return value; True if a dragging pointer is within $self or one of its children..

get-drop

Returns the Gnome::Gdk4::Drop of a current Drag-and-Drop operation over the widget of $self.

method get-drop (--> N-Object )

Return value; The Gnome::Gdk4::Drop currently happening within $self.

is-pointer

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

method is-pointer (--> Bool )

Return value; True if a dragging pointer is within $self but not one of its children.

Signals

enter

Signals that the pointer has entered the widget.

method handler (
  gdouble $x,
  gdouble $y,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::DropControllerMotion :$_widget,
  *C<user>-options
)
  • $x; coordinates of pointer location.

  • $y; coordinates of pointer location.

  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::DropControllerMotion object.

  • $_widget; The object which registered the signal. User code may have left the object going out of scope.

  • user-options; A list of named arguments provided at the .register-signal() method from Gnome::GObject::Object.

leave

Signals that the pointer has left the widget.

method handler (
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::DropControllerMotion :$_widget,
  *C<user>-options
)
  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::DropControllerMotion object.

  • $_widget; The object which registered the signal. User code may have left the object going out of scope.

  • user-options; A list of named arguments provided at the .register-signal() method from Gnome::GObject::Object.

motion

Emitted when the pointer moves inside the widget.

method handler (
  gdouble $x,
  gdouble $y,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::DropControllerMotion :$_widget,
  *C<user>-options
)
  • $x; the x coordinate.

  • $y; the y coordinate.

  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::DropControllerMotion object.

  • $_widget; The object which registered the signal. User code may have left the object going out of scope.

  • user-options; A list of named arguments provided at the .register-signal() method from Gnome::GObject::Object.