A lightweight reactive document library.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

94 lines
2.5 KiB

  1. open Notty
  2. open Nottui
  3. val empty_lwd : ui Lwd.t
  4. (* Primitive printing *)
  5. val string : ?attr:attr -> string -> ui
  6. val int : ?attr:attr -> int -> ui
  7. val bool : ?attr:attr -> bool -> ui
  8. val float_ : ?attr:attr -> float -> ui
  9. (* Printf support *)
  10. val printf : ?attr:attr -> ('a, unit, string, ui) format4 -> 'a
  11. val kprintf : (ui -> 'a) -> ?attr:attr -> ('b, unit, string, 'a) format4 -> 'b
  12. val fmt : ?attr:attr -> ('a, Format.formatter, unit, ui) format4 -> 'a
  13. val kfmt : (ui -> 'a) -> ?attr:attr -> ('b, Format.formatter, unit, 'a) format4 -> 'b
  14. (* FIXME Menu *)
  15. (*val menu_overlay : ?dx:'a -> ?dy:'b -> 'c -> 'd -> 'e*)
  16. val main_menu_item : string -> (unit -> 'a) -> ui Lwd.t
  17. val sub_menu_item : string -> (unit -> 'a) -> ui Lwd.t
  18. val sub_entry : string -> (unit -> unit) -> ui
  19. (* FIXME Explain how scrolling works *)
  20. val scroll_step : int
  21. type scroll_state = { position : int; bound : int; visible : int; total : int }
  22. val default_scroll_state : scroll_state
  23. val vscroll_area :
  24. state:scroll_state Lwd.t ->
  25. change:([> `Action | `Content ] -> scroll_state -> unit) ->
  26. ui Lwd.t -> ui Lwd.t
  27. val scroll_area :
  28. ?offset:int * int -> ui Lwd.t -> ui Lwd.t
  29. (* FIXME Explain panes *)
  30. val v_pane : ui Lwd.t -> ui Lwd.t -> ui Lwd.t
  31. val h_pane : ui Lwd.t -> ui Lwd.t -> ui Lwd.t
  32. (* FIXME Edit field *)
  33. val edit_field :
  34. ?focus:Focus.handle ->
  35. (string * int) Lwd.t ->
  36. on_change:(string * int -> unit) ->
  37. on_submit:(string * int -> unit) -> ui Lwd.t
  38. (* FIXME Tabs *)
  39. val tabs : (string * (unit -> ui Lwd.t)) list -> ui Lwd.t
  40. (* FIXME Flex box *)
  41. val flex_box : ?w:int Lwd.t -> ui Lwd.t list -> ui Lwd.t
  42. (* FIXME Unfoldable *)
  43. val unfoldable :
  44. ?folded_by_default:bool ->
  45. ui Lwd.t -> (unit -> ui Lwd.t) -> ui Lwd.t
  46. (* FIXME Boxes *)
  47. val hbox : ui Lwd.t list -> ui Lwd.t
  48. val vbox : ui Lwd.t list -> ui Lwd.t
  49. val zbox : ui Lwd.t list -> ui Lwd.t
  50. (* FIXME List *)
  51. val vlist : ?bullet:string -> ui Lwd.t list -> ui Lwd.t
  52. val vlist_with :
  53. ?bullet:string ->
  54. ?filter:('a -> bool) Lwd.t ->
  55. ('a -> ui Lwd.t) -> 'a list Lwd.t -> ui Lwd.t
  56. val grid :
  57. ?max_h:int -> ?max_w:int ->
  58. ?pad:gravity -> ?crop:gravity -> ?bg:attr ->
  59. ?h_space:int -> ?v_space:int ->
  60. ?headers:ui Lwd.t list ->
  61. ui Lwd.t list list -> ui Lwd.t
  62. val button : ?attr:attr -> string -> (unit -> unit) -> ui
  63. val file_select :
  64. ?abs:bool ->
  65. ?filter:(String.t -> bool) ->
  66. on_select:(string -> unit) -> unit -> ui Lwd.t
  67. val toggle : ?init:bool -> string Lwd.t -> (bool -> unit) -> ui Lwd.t
  68. val toggle' : string Lwd.t -> bool Lwd.var -> ui Lwd.t