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

Module Wrappers.Cell_area_context

type t = [ `cell_area_context | `object_ ] Gobject.obj
val reset : t -> unit

Resets any previously cached request and allocation data.

When underlying `GtkTreeModel` data changes its important to reset the context if the content size is allowed to shrink. If the content size is only allowed to grow (this is usually an option for views rendering large data stores as a measure of optimization), then only the row that changed or was inserted needs to be (re)requested with gtk_cell_area_get_preferred_width().

When the new overall size of the context requires that the allocated size changes (or whenever this allocation changes at all), the variable row sizes need to be re-requested for every row.

For instance, if the rows are displayed all with the same width from top to bottom then a change in the allocated width necessitates a recalculation of all the displayed row heights using gtk_cell_area_get_preferred_height_for_width().

val push_preferred_width : t -> int -> int -> unit

Causes the minimum and/or natural width to grow if the new proposed sizes exceed the current minimum and natural width.

This is used by `GtkCellAreaContext` implementations during the request process over a series of `GtkTreeModel` rows to progressively push the requested width over a series of gtk_cell_area_get_preferred_width() requests.

val push_preferred_height : t -> int -> int -> unit

Causes the minimum and/or natural height to grow if the new proposed sizes exceed the current minimum and natural height.

This is used by `GtkCellAreaContext` implementations during the request process over a series of `GtkTreeModel` rows to progressively push the requested height over a series of gtk_cell_area_get_preferred_height() requests.

val get_preferred_width_for_height : t -> int -> int * int

Gets the accumulative preferred width for @height for all rows which have been requested for the same said @height with this context.

After gtk_cell_area_context_reset() is called and/or before ever requesting the size of a `GtkCellArea`, the returned values are -1.

val get_preferred_width : t -> int * int

Gets the accumulative preferred width for all rows which have been requested with this context.

After gtk_cell_area_context_reset() is called and/or before ever requesting the size of a `GtkCellArea`, the returned values are 0.

val get_preferred_height_for_width : t -> int -> int * int

Gets the accumulative preferred height for @width for all rows which have been requested for the same said @width with this context.

After gtk_cell_area_context_reset() is called and/or before ever requesting the size of a `GtkCellArea`, the returned values are -1.

val get_preferred_height : t -> int * int

Gets the accumulative preferred height for all rows which have been requested with this context.

After gtk_cell_area_context_reset() is called and/or before ever requesting the size of a `GtkCellArea`, the returned values are 0.

val get_area : t -> [ `cell_area | `initially_unowned | `object_ ] Gobject.obj

Fetches the `GtkCellArea` this @context was created by.

This is generally unneeded by layouting widgets; however, it is important for the context implementation itself to fetch information about the area it is being used for.

For instance at `GtkCellAreaContextClass.allocate()` time it’s important to know details about any cell spacing that the `GtkCellArea` is configured with in order to compute a proper allocation.

val get_allocation : t -> int * int

Fetches the current allocation size for @context.

If the context was not allocated in width or height, or if the context was recently reset with gtk_cell_area_context_reset(), the returned value will be -1.

val allocate : t -> int -> int -> unit

Allocates a width and/or a height for all rows which are to be rendered with @context.

Usually allocation is performed only horizontally or sometimes vertically since a group of rows are usually rendered side by side vertically or horizontally and share either the same width or the same height. Sometimes they are allocated in both horizontal and vertical orientations producing a homogeneous effect of the rows. This is generally the case for `GtkTreeView` when `GtkTreeView:fixed-height-mode` is enabled.

val get_minimum_height : t -> int

Get property: minimum-height

val get_minimum_width : t -> int

Get property: minimum-width

val get_natural_height : t -> int

Get property: natural-height

val get_natural_width : t -> int

Get property: natural-width