flush stdout
;;
-let element_over mathview (element : Gdome.element option) _ =
+let element_over mathview ((element : Gdome.element option), _, _, _) =
print_endline ("element_over: " ^
(match element with
None -> "element_over on nothing"
end
| None -> assert false (* every element has a parent *)
-let click mathview (element : Gdome.element option) _ =
+let click mathview ((element : Gdome.element option), _, _, _) =
let module G = Gdome in
match element with
None -> print_string "CLICKED ON NOTHING\n" ; flush stdout
let selection =
match mathview#get_selection with
Some element -> element#get_tagName#to_string
- | None -> "no selection!"
+ | None -> "no selection! but there are " ^ (string_of_int (List.length mathview#get_selections)) ^ " multiple selections!"
in
print_string ("selection: " ^ selection ^ "\n") ;
flush stdout
mathview#set_selection None ;
mathview#remove_selections
+let select_over (mathview : GMathViewAux.multi_selection_math_view) =
+ (fun (_,_,_,state) ->
+ let c =
+ function
+ `SHIFT -> "shift "
+ | `LOCK -> "lock "
+ | `CONTROL -> "control "
+ | `MOD1 -> "mod1 "
+ | _ -> "nomod "
+ in
+ List.iter (fun x -> print_string (c x)) (Gdk.Convert.modifier state) ;
+ print_char '\n' ;
+ flush stdout)
+
let unload mathview () =
mathview#unload ;
print_string "unload: SEEMS TO WORK\n" ;
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(button_load_dom#connect#clicked (load_doc mathview)) ;
(* ignore(button_get_element_at#connect#clicked (get_element_at mathview)) ; *)
(* Main Loop *)