PageRenderTime 15ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/visualiser/msg_count.ml

http://github.com/hhughes/ocaml-frui
OCaml | 17 lines | 14 code | 3 blank | 0 comment | 0 complexity | 18acd09f6337db05b63a8d9ed0a53c2d MD5 | raw file
 1open Fvar
 2
 3class msg_count (e : Dom.element) =
 4object (self)
 5  val mc = new fvar 0
 6  method inc = mc#set (mc#get + 1)
 7  method init =
 8    let count_txt = (Dom.document#createTextNode "" : Dom.text ) in
 9    ignore (Froc.lift (fun c -> ignore (count_txt#_set_data (string_of_int c))) mc#b);
10    ignore (e#appendChild count_txt);
11
12  initializer self#init
13end
14
15let init (e : Dom.element) t0 t1 =
16  let m = new msg_count e in
17  m