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.gdk/Ocgtk_gdk/Gdk/Wrappers/Popup/index.html

Module Wrappers.Popup

type t = [ `popup ] Gobject.obj
val from_gobject : 'a Gobject.obj -> t
val present : t -> int -> int -> [ `popup_layout ] Gobject.obj -> bool

Present @popup after having processed the `GdkPopupLayout` rules.

If the popup was previously now showing, it will be showed, otherwise it will change position according to @layout.

After calling this function, the result should be handled in response to the signal@Gdk.Surface::layout signal being emitted. The resulting popup position can be queried using method@Gdk.Popup.get_position_x, method@Gdk.Popup.get_position_y, and the resulting size will be sent as parameters in the layout signal. Use method@Gdk.Popup.get_rect_anchor and method@Gdk.Popup.get_surface_anchor to get the resulting anchors.

Presenting may fail, for example if the @popup is set to autohide and is immediately hidden upon being presented. If presenting failed, the signal@Gdk.Surface::layout signal will not me emitted.

val get_surface_anchor : t -> Gdk_enums.gravity

Gets the current popup surface anchor.

The value returned may change after calling method@Gdk.Popup.present, or after the signal@Gdk.Surface::layout signal is emitted.

val get_rect_anchor : t -> Gdk_enums.gravity

Gets the current popup rectangle anchor.

The value returned may change after calling method@Gdk.Popup.present, or after the signal@Gdk.Surface::layout signal is emitted.

val get_position_y : t -> int

Obtains the position of the popup relative to its parent.

val get_position_x : t -> int

Obtains the position of the popup relative to its parent.

val get_parent : t -> [ `surface | `object_ ] Gobject.obj option

Returns the parent surface of a popup.

val get_autohide : t -> bool

Returns whether this popup is set to hide on outside clicks.