/src/frui.ml

http://github.com/hhughes/ocaml-frui · OCaml · 17 lines · 14 code · 3 blank · 0 comment · 0 complexity · 6513de478c34e08f32ff8d2f204b7a12 MD5 · raw file

  1. open Logger
  2. open Dialog
  3. module D = Dom
  4. module F = Froc
  5. module Fd = Froc_dom
  6. let onload () =
  7. debug "onload";
  8. let main = (D.document#getElementById "main" : D.element) in
  9. let new_dlg = (D.document#createElement "button" : D.button) in
  10. ignore (set_text (new_dlg :> D.element) "add dialog");
  11. ignore (main#appendChild new_dlg);
  12. new_dlg#_set_onclick (fun _ -> ignore (new dialog main ()); true)
  13. ;;
  14. D.window#_set_onload onload