I create a canvas in js_of_ocaml as below.
(* create document *)
let document = Dom_html.window##document
(* function to create canvas *)
let create_canvas () =
let canvas = Dom_html.createCanvas document in
canvas##width <- 500;
canvas##height <- 500;
canvas
(* create canvas *)
let canvas = create_canvas ()
let start _ =
let main = get_main () in
Dom.appendChild main canvas;
Js._false in
Dom_html.window##onload <- Dom_html.handler start
I can see only a white screen.
Now, I want to add a horizontal scroll bar to the canvas.
I think I have to make a box with a horizontal scroll bar which is smaller than the white canvas, and the white canvas is in the box.
How can I do that?