package mlpost-lablgtk

  1. Overview
  2. Docs

Abstract lablgtk in order to display Mlpost figures inside a very simple interface

type interface

An interface is composed by one control window and by some display window

val new_interface : ?width:int -> ?height:int -> ?title:string -> unit -> interface

create a new interface with an empty control window

Interfaces

val create_text : interface -> ?label:string -> string -> (string -> unit) -> unit

create_text ~label get set adds to the control window a text input. get is the initial value, set is called each times the value of the text input is changed.

val create_option : interface -> ?label:string -> (string * (unit -> unit)) list -> unit

create_option ~label value_list adds to the control window a radio menu item. value_list is a pair of one of the choice and the callback function used when this choice is selected.

val remove_pic : interface -> (unit -> Mlpost.Command.t) -> unit

remove_pic gen_pic removes a display window created by add_pic gen_pic

Required function

functions needed to see one mlpost picure :

val add_pic : interface -> ?width:int -> ?height:int -> ?title:string -> ?show_corner:bool -> ?auto_aspect:auto_aspect -> (unit -> Mlpost.Command.t) -> unit

add_pic get_pic add a new display window. get_pic is called each times the window must be refreshed. If the value of one of the interfaces is changed, the displayed picure is refreshed.

val main : interface -> unit

Start the main loop. During the main loop some texts or options can be added and add_pic can be called

OCaml

Innovation. Community. Security.