it kinda worked but it's so slow i decided to try lablgtk instead

This commit is contained in:
cqc
2024-03-31 11:08:54 -05:00
parent 3c32f068fb
commit 69cb7dffaf
3 changed files with 10 additions and 261 deletions

View File

@ -15,7 +15,7 @@ let resize ~container ~textbox () =
textbox##.style##.height := Js.string "auto";
textbox##.style##.height
:= Js.string (Printf.sprintf "%dpx" (max 18 textbox##.scrollHeight));
container##.scrollTop := container##.scrollHeight;
(* container##.scrollTop := container##.scrollHeight; *)
Lwt.return ()
let appendchild ~container html =
@ -37,7 +37,7 @@ let _ =
[ txt "starting..." ];
]);
let textbox : 'a Js.t =
by_id_coerce "userinput" Dom_html.CoerceTo.textarea
by_id_coerce "code" Dom_html.CoerceTo.textarea
in
let rootrepo = Store.test_pull () in
rootrepo >>= fun (_upstream, t) ->
@ -65,11 +65,11 @@ let _ =
(* setup handlers *)
textbox##.onkeyup :=
Dom_html.handler (fun _ ->
Lwt.async (resize ~container ~textbox);
(* Lwt.async (resize ~container ~textbox); *)
Js._true);
textbox##.onchange :=
Dom_html.handler (fun _ ->
Lwt.async (resize ~container ~textbox);
(* Lwt.async (resize ~container ~textbox); *)
Js._true);
textbox##.onkeydown :=
Dom_html.handler