DragIconRef

public struct DragIconRef : DragIconProtocol, GWeakCapturing

GtkDragIcon is a GtkRoot implementation for drag icons.

A drag icon moves with the pointer during a Drag-and-Drop operation and is destroyed when the drag ends.

To set up a drag icon and associate it with an ongoing drag operation, use [funcGtk.DragIcon.get_for_drag] to get the icon for a drag. You can then use it like any other widget and use [methodGtk.DragIcon.set_child] to set whatever widget should be used for the drag icon.

Keep in mind that drag icons do not allow user input.

The DragIconRef type acts as a lightweight Swift reference to an underlying GtkDragIcon instance. It exposes methods that can operate on this data type through DragIconProtocol conformance. Use DragIconRef only as an unowned reference to an existing GtkDragIcon instance.

  • ptr
    Untyped pointer to the underlying `GtkDragIcon` instance.
    

    For type-safe access, use the generated, typed pointer drag_icon_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

DragIcon Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkDragIcon>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkDragIcon>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkDragIcon>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkDragIcon>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements DragIconProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : DragIconProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> DragIconRef where T : DragIconProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to DragIconProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to DragIconProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to DragIconProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to DragIconProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to DragIconProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a widget that can be used as a drag icon for the given
    

    value.

    Supported types include strings, GdkRGBA and GtkTextBuffer. If GTK does not know how to create a widget for a given value, it will return nil.

    This method is used to set the default drag icon on drag-and-drop operations started by GtkDragSource, so you don’t need to set a drag icon using this function there.

    Declaration

    Swift

    @inlinable
    static func createWidgetFor<ValueT>(value: ValueT) -> WidgetRef! where ValueT : ValueProtocol
  • Gets the GtkDragIcon in use with drag.

    If no drag icon exists yet, a new one will be created and shown.

    Declaration

    Swift

    @inlinable
    static func getFor<DragT>(drag: DragT) -> WidgetRef! where DragT : DragProtocol