Basics
Guides
API Reference
Basics
Guides
API Reference
[23:7] extends: object
Represents the target of an ongoing DND operation. Possible drop sites get
informed about the status of the ongoing drag operation with events of type
GDK_DRAG_ENTER, GDK_DRAG_LEAVE, GDK_DRAG_MOTION and GDK_DROP_START.
The GdkDrop object can be obtained from these [class@Gdk.Event] types using
[method@Gdk.DNDEvent.get_drop]. The actual data transfer is initiated from
the target side via an async read, using one of the GdkDrop methods for
this purpose: [method@Gdk.Drop.read_async] or
[method@Gdk.Drop.read_value_async]. GTK provides a higher level abstraction
based on top of these functions, and so they are not normally needed in GTK
applications. See the "Drag and Drop" section of the GTK documentation for
more information.
Drop (Handle = null)
Creates a new
Dropby wrapping a native handle or another wrapper.
Handle is the native handle or another wrapper whose handle to adopt.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.finish (string action)
Ends the drag operation after a drop. The @action must be a single action selected from the actions available via [method@Gdk.Drop.get_actions].
action is the action performed by the destination or GDK_ACTION_NONE if the drop failed.None.get_actions ()
Returns the possible actions for this
GdkDrop. If this value contains multiple actions - i.e. [func@Gdk.DragAction.is_unique] returns false for the result - [method@Gdk.Drop.finish] must choose the action to use when accepting the drop. This will only happen if you passedGDK_ACTION_ASKas one of the possible actions in [method@Gdk.Drop.status].GDK_ACTION_ASKitself will not be included in the actions returned by this function. This value may change over the lifetime of the [class@Gdk.Drop] both as a response to source side actions as well as to calls to [method@Gdk.Drop.status] or [method@Gdk.Drop.finish]. The source side will not change this value anymore once a drop has started.
get_device ()
Returns the
GdkDeviceperforming the drop.
get_display ()
Gets the
GdkDisplaythat @self was created for.
get_drag ()
If this is an in-app drag-and-drop operation, returns the
GdkDragthat corresponds to this drop. If it is not,NULLis returned.
get_formats ()
Returns the
GdkContentFormatsthat the drop offers the data to be read in.
get_surface ()
Returns the
GdkSurfaceperforming the drop.
read_value_finish (object result)
Finishes an async drop read. See [method@Gdk.Drop.read_value_async].
result is a GAsyncResult.status (string actions, string preferred)
Selects all actions that are potentially supported by the destination. When calling this function, do not restrict the passed in actions to the ones provided by [method@Gdk.Drop.get_actions]. Those actions may change in the future, even depending on the actions you provide here. The
action is a hint to the drag-and-drop mechanism about which action to use when multiple actions are possible. This function should be called by drag destinations in response to GDK_DRAG_ENTER or GDK_DRAG_MOTION events. If the destination does not yet know the exact actions it supports, it should set any possible actions first and then later call this function again.actions is Supported actions of the destination, or GDK_ACTION_NONE to indicate that a drop will not be accepted.preferred is A unique action that's a member of @actions indicating the preferred action.None.[226:14] static extends: object
Generated metadata helpers for Drop class surfaces.
properties ()
Returns property metadata for
Drop.
A list.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.