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/Drop_target/index.html

Module Wrappers.Drop_target

type t = [ `drop_target | `event_controller | `object_ ] Gobject.obj

Create a new DropTarget

val set_preload : t -> bool -> unit

Sets whether data should be preloaded on hover.

val set_gtypes : t -> Gobject.Type.t array option -> Gsize.t -> unit

Sets the supported `GType`s for this drop target.

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

Sets the actions that this drop target supports.

val reject : t -> unit

Rejects the ongoing drop operation.

If no drop operation is ongoing, i.e when property@Gtk.DropTarget:current-drop is %NULL, 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.

val get_value : t -> Gobject.Value.t option

Gets the current drop data, as a `GValue`.

val get_preload : t -> bool

Gets whether data should be preloaded on hover.

val get_gtypes : t -> Gobject.Type.t array option * Gsize.t

Gets the list of supported `GType`s that can be dropped on the target.

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

val get_formats : t -> Ocgtk_gdk.Gdk.Wrappers.Content_formats.t option

Gets the data formats that this drop target accepts.

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

val get_drop : t -> Ocgtk_gdk.Gdk.Wrappers.Drop.t option

Gets the currently handled drop operation.

If no drop operation is going on, %NULL is returned.

val get_current_drop : t -> Ocgtk_gdk.Gdk.Wrappers.Drop.t option

Gets the currently handled drop operation.

If no drop operation is going on, %NULL is returned.

val get_actions : t -> Ocgtk_gdk.Gdk.dragaction

Gets the actions that this drop target supports.

val on_accept : ?after:bool -> t -> callback:(drop:Ocgtk_gdk.Gdk.Wrappers.Drop.t -> bool) -> Gobject.Signal.handler_id
val on_drop : ?after:bool -> t -> callback:(value:Gobject.Value.t -> x:float -> y:float -> bool) -> Gobject.Signal.handler_id
val on_enter : ?after:bool -> t -> callback:(x:float -> y:float -> Ocgtk_gdk.Gdk_enums.dragaction) -> Gobject.Signal.handler_id
val on_leave : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_motion : ?after:bool -> t -> callback:(x:float -> y:float -> Ocgtk_gdk.Gdk_enums.dragaction) -> Gobject.Signal.handler_id