package bogue

  1. Overview
  2. Docs

Windows

In order to display a Layout, you need to create a Window.t for it, and pass it as argument of Main.make. Windows are create by SDL, and hence will appear with the usual decorations of your Desktop Environment.

type t
val create : ?on_close:(t -> unit) -> Layout.t -> t

Create a window from the given layout. The layout must not belong to any room. If the layout is hidden, the window will be created but not shown.

  • parameter on_close

    Set the function to be executed when the user wants to close the window. By default, the window will be destroyed. Hence, setting a function can prevent the window from being closed. However, if this is the sole open window, clicking on the close button will also emit the 'Quit' event, and will terminate Bogue anyways.

val on_close : t -> (t -> unit) option -> unit

Modify the on_close parameter of create.

val destroy : t -> unit

Ask Bogue to destroy the window.

val set_size : w:int -> h:int -> t -> unit

Set window size in physical pixels. Only works after the window is physically created by Main.run. However, you may use set_size in advance with Sync.push.

val maximize_width : t -> unit

See remarks in set_size.

OCaml

Innovation. Community. Security.