1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
let clic im =
let l = ref [] in
let i = ref 0 in
open_sho im;
let rec aux () =
match read_key() with
|'s' -> (*start *)
begin
let attends = Graphics.wait_next_event [ Button_down] in
let abscisse = attends.mouse_x
and ordonnee = attends.mouse_y
in
l := maj_liste !l (abscisse,ordonnee);
while attends.button do
abscisse = attends.mouse_x;
ordonnee = attends.mouse_y;
l := maj_liste !l (abscisse,ordonnee);
i := !i+1;
done;
aux ();
end;
|'c' -> close_graph()
|_ -> aux()
in aux ();
!l;; |
Partager