From 1bca5f712ea94b115658f933a6689f9d700887a3 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Wed, 15 Jun 2005 12:39:04 +0000 Subject: [PATCH] - better printing of modifiers - quit on window destroy --- helm/DEVEL/lablgtkmathview/test/test.ml | 29 +++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/helm/DEVEL/lablgtkmathview/test/test.ml b/helm/DEVEL/lablgtkmathview/test/test.ml index 14e14bf7a..d1821bfca 100644 --- a/helm/DEVEL/lablgtkmathview/test/test.ml +++ b/helm/DEVEL/lablgtkmathview/test/test.ml @@ -223,17 +223,22 @@ let test_reset_selections (mathview : GMathViewAux.multi_selection_math_view) () let select_over (mathview : GMathViewAux.multi_selection_math_view) = (fun (_,_,_,state) -> - let c = - function - `SHIFT -> "shift " - | `LOCK -> "lock " - | `CONTROL -> "control " - | `MOD1 -> "mod1 " - | _ -> "nomod " + let c = function + | `SHIFT -> "shift" + | `LOCK -> "lock" + | `CONTROL -> "control" + | `MOD1 -> "mod1" + | _ -> "" in - List.iter (fun x -> print_string (c x)) (Gdk.Convert.modifier state) ; - print_char '\n' ; - flush stdout) + let msg = + String.concat "," + (List.filter (fun s -> s <> "") + (List.map c (Gdk.Convert.modifier state))) + in + if msg <> "" then begin + print_endline ("modifiers: " ^ msg); + flush stdout + end) let unload mathview () = mathview#unload ; @@ -371,9 +376,9 @@ ignore(button_get_log_verbosity#connect#clicked (get_log_verbosity mathview)) ; ignore(mathview#connect#click (click mathview)) ; ignore(mathview#connect#selection_changed (selection_changed mathview)); ignore(mathview#connect#element_over (element_over mathview)) ; -ignore(self#connect#select_over (select_over mathview)); - +ignore(mathview#connect#select_over (select_over mathview)); ignore(button_load_dom#connect#clicked (load_doc mathview)) ; +ignore(main_window#connect#destroy (fun _ -> GMain.quit ())); (* ignore(button_get_element_at#connect#clicked (get_element_at mathview)) ; *) (* Main Loop *) main_window#show () ; -- 2.39.2