bogue

GUI library for ocaml, with animations, based on SDL2
Library bogue
Module Bogue . Popup
Dependency graph
val add_screen : ?color:Draw.color -> Layout.t -> Layout.t

Add a screen on top of the layout. This can be useful to make the whole layout clickable as a whole.

  • returns

    the screen.

val attach : ?bg:Draw.color -> ?show:bool -> Layout.t -> Layout.t -> Layout.t

Generic modal type popup

attach house layout adds two layers on top of the house: one for the screen to hide the house, one for the layout on top of the screen.

  • returns

    the screen.

val info : ?w:int -> ?h:int -> ?button:string -> string -> Layout.t -> unit

Add to the layout a modal popup with a text and a close button. By default, button="Close".

val yesno : ?w:int -> ?h:int -> ?yes:string -> ?no:string -> yes_action:( unit -> unit ) -> no_action:( unit -> unit ) -> string -> Layout.t -> unit

Add to the layout a modal popup with two yes/no buttons. By default, yes="Yes" and no="No".

val two_buttons : ?w:int -> ?h:int -> label1:string -> label2:string -> action1:( unit -> unit ) -> action2:( unit -> unit ) -> content:Layout.t -> Layout.t -> unit
type position =
| LeftOf
| RightOf
| Above
| Below
| Mouse
val tooltip : ?background:Layout.background -> ?position:position -> string -> target:Layout.t -> Widget.t -> Layout.t -> unit

tooltip text ~target widget layout adds a tooltip which will appear on layout, next to target (which should be a sublayout of layout), when the widget gets mouse focus and mouse is idle for some time on it. A tooltip it not a modal popup, it does not prevent from interacting with the rest of the layout.