package nottui

  1. Overview
  2. Docs
val step : ?process_event:bool -> ?timeout:float -> renderer:Renderer.t -> Notty_unix.Term.t -> ui Lwd.root -> unit

Run one step of the main loop.

Update output image describe by the provided root. If process_event, wait up to timeout seconds for an input event, then consume and dispatch it.

val run : ?tick_period:float -> ?tick:(unit -> unit) -> ?term:Notty_unix.Term.t -> ?renderer:Renderer.t -> ?quit:bool Lwd.var -> ui Lwd.t -> unit

Repeatedly run steps of the main loop, until either:

  • quit becomes true,
  • the ui computation raises an exception,
  • if quit was not provided, wait for Ctrl-Q event

Specific term or renderer instances can be provided, otherwise new ones will be allocated and released.

To simulate concurrency in a polling fashion, tick function and period can be provided. Use the Lwt backend for real concurrency.

OCaml

Innovation. Community. Security.