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

Module Wrappers.Drawing_area

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

Create a new DrawingArea

val set_content_width : t -> int -> unit

Sets the desired width of the contents of the drawing area.

Note that because widgets may be allocated larger sizes than they requested, it is possible that the actual width passed to your draw function is larger than the width set here. You can use method@Gtk.Widget.set_halign to avoid that.

If the width is set to 0 (the default), the drawing area may disappear.

val set_content_height : t -> int -> unit

Sets the desired height of the contents of the drawing area.

Note that because widgets may be allocated larger sizes than they requested, it is possible that the actual height passed to your draw function is larger than the height set here. You can use method@Gtk.Widget.set_valign to avoid that.

If the height is set to 0 (the default), the drawing area may disappear.

val get_content_width : t -> int

Retrieves the content width of the `GtkDrawingArea`.

val get_content_height : t -> int

Retrieves the content height of the `GtkDrawingArea`.

val on_resize : ?after:bool -> t -> callback:(width:int -> height:int -> unit) -> Gobject.Signal.handler_id