Task

Create a window that has:

   a label that says   "There have been no clicks yet" 
   a button that says   "click me"


Upon clicking the button with the mouse, the label should change and show the number of times the button has been clicked.




#directory "+labltk"
#load "labltk.cma"
 
let () =
  let top = Tk.openTk() in
  Wm.title_set top "Tk-OCaml Example";
  let label = Label.create ~text:"There have been no clicks yet" top in
  let b =
    Button.create
        ~text:"click me"
        ~command:(fun () -> Tk.closeTk (); exit 0)
        top
  in
  Tk.pack [Tk.coe label; Tk.coe b];
  Tk.mainLoop ();
;;