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

Module Wrappers.Popover

type t = [ `popover | `widget | `initially_unowned | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new Popover

val set_position : t -> Gtk_enums.positiontype -> unit

Sets the preferred position for @popover to appear.

If the @popover is currently visible, it will be immediately updated.

This preference will be respected where possible, although on lack of space (eg. if close to the window edges), the `GtkPopover` may choose to appear on the opposite side.

val set_pointing_to : t -> Ocgtk_gdk.Gdk.Wrappers.Rectangle.t option -> unit

Sets the rectangle that @popover points to.

This is in the coordinate space of the @popover parent.

val set_offset : t -> int -> int -> unit

Sets the offset to use when calculating the position of the popover.

These values are used when preparing the struct@Gdk.PopupLayout for positioning the popover.

val set_mnemonics_visible : t -> bool -> unit

Sets whether mnemonics should be visible.

val set_has_arrow : t -> bool -> unit

Sets whether this popover should draw an arrow pointing at the widget it is relative to.

val set_default_widget : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj option -> unit

Sets the default widget of a `GtkPopover`.

The default widget is the widget that’s activated when the user presses Enter in a dialog (for example). This function sets or unsets the default widget for a `GtkPopover`.

val set_child : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj option -> unit

Sets the child widget of @popover.

val set_cascade_popdown : t -> bool -> unit

If @cascade_popdown is %TRUE, the popover will be closed when a child modal popover is closed.

If %FALSE, @popover will stay visible.

val set_autohide : t -> bool -> unit

Sets whether @popover is modal.

A modal popover will grab the keyboard focus on it when being displayed. Focus will wrap around within the popover. Clicking outside the popover area or pressing Esc will dismiss the popover.

Called this function on an already showing popup with a new autohide value different from the current one, will cause the popup to be hidden.

val present : t -> unit

Allocate a size for the `GtkPopover`.

This function needs to be called in size-allocate by widgets who have a `GtkPopover` as child. When using a layout manager, this is happening automatically.

To make a popover appear on screen, use method@Gtk.Popover.popup.

val popup : t -> unit

Pops @popover up.

val popdown : t -> unit

Pops @popover down.

This may have the side-effect of closing a parent popover as well. See property@Gtk.Popover:cascade-popdown.

val get_position : t -> Gtk_enums.positiontype

Returns the preferred position of @popover.

val get_pointing_to : t -> bool * Ocgtk_gdk.Gdk.Wrappers.Rectangle.t

Gets the rectangle that the popover points to.

If a rectangle to point to has been set, this function will return %TRUE and fill in @rect with such rectangle, otherwise it will return %FALSE and fill in @rect with the parent widget coordinates.

val get_offset : t -> int * int

Gets the offset previous set with method@Gtk.Popover.set_offset().

val get_mnemonics_visible : t -> bool

Gets whether mnemonics are visible.

val get_has_arrow : t -> bool

Gets whether this popover is showing an arrow pointing at the widget that it is relative to.

val get_child : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj option

Gets the child widget of @popover.

val get_cascade_popdown : t -> bool

Returns whether the popover will close after a modal child is closed.

val get_autohide : t -> bool

Returns whether the popover is modal.

See method@Gtk.Popover.set_autohide for the implications of this.

val on_activate_default : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_closed : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id