package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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