package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Drag_source/index.html

Module Wrappers.Drag_source

type t = [ `drag_source | `gesture_single | `gesture | `event_controller | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new DragSource

val set_icon : t -> Ocgtk_gdk.Gdk.Wrappers.Paintable.t option -> int -> int -> unit

Sets a paintable to use as icon during DND operations.

The hotspot coordinates determine the point on the icon that gets aligned with the hotspot of the cursor.

If @paintable is %NULL, a default icon is used.

This function can be called before a drag is started, or in a signal@Gtk.DragSource::prepare or signal@Gtk.DragSource::drag-begin signal handler.

val set_content : t -> Ocgtk_gdk.Gdk.Wrappers.Content_provider.t option -> unit

Sets a content provider on a `GtkDragSource`.

When the data is requested in the cause of a DND operation, it will be obtained from the content provider.

This function can be called before a drag is started, or in a handler for the signal@Gtk.DragSource::prepare signal.

You may consider setting the content provider back to %NULL in a signal@Gtk.DragSource::drag-end signal handler.

val set_actions : t -> Ocgtk_gdk.Gdk.dragaction -> unit

Sets the actions on the `GtkDragSource`.

During a DND operation, the actions are offered to potential drop targets. If @actions include %GDK_ACTION_MOVE, you need to listen to the signal@Gtk.DragSource::drag-end signal and handle @delete_data being %TRUE.

This function can be called before a drag is started, or in a handler for the signal@Gtk.DragSource::prepare signal.

val get_drag : t -> Ocgtk_gdk.Gdk.Wrappers.Drag.t option

Returns the underlying `GdkDrag` object for an ongoing drag.

val get_content : t -> Ocgtk_gdk.Gdk.Wrappers.Content_provider.t option

Gets the current content provider of a `GtkDragSource`.

val get_actions : t -> Ocgtk_gdk.Gdk.dragaction

Gets the actions that are currently set on the `GtkDragSource`.

val drag_cancel : t -> unit

Cancels a currently ongoing drag operation.

val on_drag_begin : ?after:bool -> t -> callback:(drag:Ocgtk_gdk.Gdk.Wrappers.Drag.t -> unit) -> Gobject.Signal.handler_id
val on_drag_cancel : ?after:bool -> t -> callback: (drag:Ocgtk_gdk.Gdk.Wrappers.Drag.t -> reason:Ocgtk_gdk.Gdk_enums.dragcancelreason -> bool) -> Gobject.Signal.handler_id
val on_drag_end : ?after:bool -> t -> callback:(drag:Ocgtk_gdk.Gdk.Wrappers.Drag.t -> delete_data:bool -> unit) -> Gobject.Signal.handler_id
val on_prepare : ?after:bool -> t -> callback: (x:float -> y:float -> Ocgtk_gdk.Gdk.Wrappers.Content_provider.t option) -> Gobject.Signal.handler_id