Module Bogue.Window

module Window: sig .. end

Windows

In order to display a Layout, Bogue needs to create a Window.t for it, and pass it as argument of Main.create. This is done automatically if you use Main.of_layouts, so most of the time you don't need to deal with Window.t's.

Windows are created 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.

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 Window.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 Window.set_size.