DropTargetProtocol

public protocol DropTargetProtocol : EventControllerProtocol

GtkDropTarget is an event controller to receive Drag-and-Drop operations.

The most basic way to use a GtkDropTarget to receive drops on a widget is to create it via [ctorGtk.DropTarget.new], passing in the GType of the data you want to receive and connect to the [signalGtk.DropTarget::drop] signal to receive the data:

static gboolean
on_drop (GtkDropTarget *target,
         const GValue  *value,
         double         x,
         double         y,
         gpointer       data)
{
  MyWidget *self = data;

  // Call the appropriate setter depending on the type of data
  // that we received
  if (G_VALUE_HOLDS (value, G_TYPE_FILE))
    my_widget_set_file (self, g_value_get_object (value));
  else if (G_VALUE_HOLDS (value, GDK_TYPE_PIXBUF))
    my_widget_set_pixbuf (self, g_value_get_object (value));
  else
    return FALSE;

  return TRUE;
}

static void
my_widget_init (MyWidget *self)
{
  GtkDropTarget *target =
    gtk_drop_target_new (G_TYPE_INVALID, GDK_ACTION_COPY);

  // This widget accepts two types of drop types: GFile objects
  // and GdkPixbuf objects
  gtk_drop_target_set_gtypes (target, (GTypes [2]) {
    G_TYPE_FILE,
    GDK_TYPE_PIXBUF,
  }, 2);

  gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (target));
}

GtkDropTarget supports more options, such as:

  • rejecting potential drops via the [signalGtk.DropTarget::accept] signal and the [methodGtk.DropTarget.reject] function to let other drop targets handle the drop
  • tracking an ongoing drag operation before the drop via the [signalGtk.DropTarget::enter], [signalGtk.DropTarget::motion] and [signalGtk.DropTarget::leave] signals
  • configuring how to receive data by setting the [propertyGtk.DropTarget:preload] property and listening for its availability via the [propertyGtk.DropTarget:value] property

However, GtkDropTarget is ultimately modeled in a synchronous way and only supports data transferred via GType. If you want full control over an ongoing drop, the [classGtk.DropTargetAsync] object gives you this ability.

While a pointer is dragged over the drop target’s widget and the drop has not been rejected, that widget will receive the GTK_STATE_FLAG_DROP_ACTIVE state, which can be used to style the widget.

If you are not interested in receiving the drop, but just want to update UI state during a Drag-and-Drop operation (e.g. switching tabs), you can use [classGtk.DropControllerMotion].

The DropTargetProtocol protocol exposes the methods and properties of an underlying GtkDropTarget instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see DropTarget. Alternatively, use DropTargetRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkDropTarget instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • drop_target_ptr Default implementation

    Typed pointer to the underlying GtkDropTarget instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkDropTarget instance.

    Declaration

    Swift

    var drop_target_ptr: UnsafeMutablePointer<GtkDropTarget>! { get }
  • Required Initialiser for types conforming to DropTargetProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

DropTarget Class

  • Bind a DropTargetPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: DropTargetPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a DropTarget property

    Declaration

    Swift

    @inlinable
    func get(property: DropTargetPropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a DropTarget property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: DropTargetPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

DropTarget signals

  • Connect a Swift signal handler to the given, typed DropTargetSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: DropTargetSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    handler

    The Swift signal handler (function or callback) to invoke on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • Connect a C signal handler to the given, typed DropTargetSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: DropTargetSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • onAccept(flags:handler:) Extension method

    Emitted on the drop site when a drop operation is about to begin.

    If the drop is not accepted, false will be returned and the drop target will ignore the drop. If true is returned, the drop is accepted for now but may be rejected later via a call to [methodGtk.DropTarget.reject] or ultimately by returning false from a [signalGtk.DropTarget::drop] handler.

    The default handler for this signal decides whether to accept the drop based on the formats provided by the drop.

    If the decision whether the drop will be accepted or rejected depends on the data, this function should return true, the [propertyGtk.DropTarget:preload] property should be set and the value should be inspected via the notify:value signal, calling [methodGtk.DropTarget.reject] if required.

    Note

    This represents the underlying accept signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onAccept(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef, _ drop: Gdk.DropRef) -> Bool) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    drop

    the GdkDrop

    handler

    true if drop is accepted Run the given callback whenever the accept signal is emitted

  • acceptSignal Extension method

    Typed accept signal for using the connect(signal:) methods

    Declaration

    Swift

    static var acceptSignal: DropTargetSignalName { get }
  • onDrop(flags:handler:) Extension method

    Emitted on the drop site when the user drops the data onto the widget.

    The signal handler must determine whether the pointer position is in a drop zone or not. If it is not in a drop zone, it returns false and no further processing is necessary.

    Otherwise, the handler returns true. In this case, this handler will accept the drop. The handler is responsible for using the given value and performing the drop operation.

    Note

    This represents the underlying drop signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onDrop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef, _ value: GLibObject.ValueRef, _ x: Double, _ y: Double) -> Bool) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    value

    the GValue being dropped

    x

    the x coordinate of the current pointer position

    y

    the y coordinate of the current pointer position

    handler

    whether the drop was accepted at the given pointer position Run the given callback whenever the drop signal is emitted

  • dropSignal Extension method

    Typed drop signal for using the connect(signal:) methods

    Declaration

    Swift

    static var dropSignal: DropTargetSignalName { get }
  • onEnter(flags:handler:) Extension method

    Emitted on the drop site when the pointer enters the widget.

    It can be used to set up custom highlighting.

    Note

    This represents the underlying enter signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onEnter(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef, _ x: Double, _ y: Double) -> Gdk.DragAction) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    x

    the x coordinate of the current pointer position

    y

    the y coordinate of the current pointer position

    handler

    Preferred action for this drag operation or 0 if dropping is not supported at the current x,y location. Run the given callback whenever the enter signal is emitted

  • enterSignal Extension method

    Typed enter signal for using the connect(signal:) methods

    Declaration

    Swift

    static var enterSignal: DropTargetSignalName { get }
  • onLeave(flags:handler:) Extension method

    Emitted on the drop site when the pointer leaves the widget.

    Its main purpose it to undo things done in [signalGtk.DropTarget::enter].

    Note

    This represents the underlying leave signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onLeave(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the leave signal is emitted

  • leaveSignal Extension method

    Typed leave signal for using the connect(signal:) methods

    Declaration

    Swift

    static var leaveSignal: DropTargetSignalName { get }
  • onMotion(flags:handler:) Extension method

    Emitted while the pointer is moving over the drop target.

    Note

    This represents the underlying motion signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onMotion(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef, _ x: Double, _ y: Double) -> Gdk.DragAction) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    x

    the x coordinate of the current pointer position

    y

    the y coordinate of the current pointer position

    handler

    Preferred action for this drag operation or 0 if dropping is not supported at the current x,y location. Run the given callback whenever the motion signal is emitted

  • motionSignal Extension method

    Typed motion signal for using the connect(signal:) methods

    Declaration

    Swift

    static var motionSignal: DropTargetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::actions signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyActions(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyActions signal is emitted

  • notifyActionsSignal Extension method

    Typed notify::actions signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyActionsSignal: DropTargetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::current-drop signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyCurrentDrop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyCurrentDrop signal is emitted

  • notifyCurrentDropSignal Extension method

    Typed notify::current-drop signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyCurrentDropSignal: DropTargetSignalName { get }
  • onNotifyDrop(flags:handler:) Extension method

    The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::drop signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyDrop(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyDrop signal is emitted

  • notifyDropSignal Extension method

    Typed notify::drop signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyDropSignal: DropTargetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::formats signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyFormats(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyFormats signal is emitted

  • notifyFormatsSignal Extension method

    Typed notify::formats signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyFormatsSignal: DropTargetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::preload signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyPreload(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyPreload signal is emitted

  • notifyPreloadSignal Extension method

    Typed notify::preload signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyPreloadSignal: DropTargetSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::value signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyValue(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DropTargetRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyValue signal is emitted

  • notifyValueSignal Extension method

    Typed notify::value signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyValueSignal: DropTargetSignalName { get }

DropTarget Class: DropTargetProtocol extension (methods and fields)

  • getActions() Extension method

    Gets the actions that this drop target supports.

    Declaration

    Swift

    @inlinable
    func getActions() -> Gdk.DragAction
  • getCurrentDrop() Extension method

    Gets the currently handled drop operation.

    If no drop operation is going on, nil is returned.

    Declaration

    Swift

    @inlinable
    func getCurrentDrop() -> Gdk.DropRef!
  • getDrop() Extension method

    Gets the currently handled drop operation.

    If no drop operation is going on, nil is returned.

    get_drop is deprecated: Use [method@Gtk.DropTarget.get_current_drop] instead

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getDrop() -> Gdk.DropRef!
  • getFormats() Extension method

    Gets the data formats that this drop target accepts.

    If the result is nil, all formats are expected to be supported.

    Declaration

    Swift

    @inlinable
    func getFormats() -> Gdk.ContentFormatsRef!
  • getGtypes(nTypes:) Extension method

    Gets the list of supported GTypes that can be dropped on the target.

    If no types have been set, NULL will be returned.

    Declaration

    Swift

    @inlinable
    func getGtypes(nTypes: UnsafeMutablePointer<gsize>! = nil) -> UnsafePointer<GType>!
  • getPreload() Extension method

    Gets whether data should be preloaded on hover.

    Declaration

    Swift

    @inlinable
    func getPreload() -> Bool
  • getValue() Extension method

    Gets the current drop data, as a GValue.

    Declaration

    Swift

    @inlinable
    func getValue() -> GLibObject.ValueRef!
  • reject() Extension method

    Rejects the ongoing drop operation.

    If no drop operation is ongoing, i.e when [propertyGtk.DropTarget:current-drop] is nil, this function does nothing.

    This function should be used when delaying the decision on whether to accept a drag or not until after reading the data.

    Declaration

    Swift

    @inlinable
    func reject()
  • set(actions:) Extension method

    Sets the actions that this drop target supports.

    Declaration

    Swift

    @inlinable
    func set(actions: Gdk.DragAction)
  • setGtypes(types:nTypes:) Extension method

    Sets the supported GTypes for this drop target.

    Declaration

    Swift

    @inlinable
    func setGtypes(types: UnsafeMutablePointer<GType>! = nil, nTypes: Int)
  • set(preload:) Extension method

    Sets whether data should be preloaded on hover.

    Declaration

    Swift

    @inlinable
    func set(preload: Bool)
  • actions Extension method

    The GdkDragActions that this drop target supports.

    Declaration

    Swift

    @inlinable
    var actions: Gdk.DragAction { get nonmutating set }
  • currentDrop Extension method

    Gets the currently handled drop operation.

    If no drop operation is going on, nil is returned.

    Declaration

    Swift

    @inlinable
    var currentDrop: Gdk.DropRef! { get }
  • drop Extension method

    The GdkDrop that is currently being performed.

    drop is deprecated: Use [property@Gtk.DropTarget:current-drop] instead

    Declaration

    Swift

    @inlinable
    var drop: Gdk.DropRef! { get }
  • formats Extension method

    The GdkContentFormats that determine the supported data formats.

    Declaration

    Swift

    @inlinable
    var formats: Gdk.ContentFormatsRef! { get }
  • preload Extension method

    Whether the drop data should be preloaded when the pointer is only hovering over the widget but has not been released.

    Setting this property allows finer grained reaction to an ongoing drop at the cost of loading more data.

    The default value for this property is false to avoid downloading huge amounts of data by accident.

    For example, if somebody drags a full document of gigabytes of text from a text editor across a widget with a preloading drop target, this data will be downloaded, even if the data is ultimately dropped elsewhere.

    For a lot of data formats, the amount of data is very small (like GDK_TYPE_RGBA), so enabling this property does not hurt at all. And for local-only Drag-and-Drop operations, no data transfer is done, so enabling it there is free.

    Declaration

    Swift

    @inlinable
    var preload: Bool { get nonmutating set }
  • value Extension method

    The value for this drop operation.

    This is nil if the data has not been loaded yet or no drop operation is going on.

    Data may be available before the [signalGtk.DropTarget::drop] signal gets emitted - for example when the [propertyGtk.DropTarget:preload] property is set. You can use the notify signal to be notified of available data.

    Declaration

    Swift

    @inlinable
    var value: GLibObject.ValueRef! { get }