-let clicked (node : Ominidom.o_mDOMNode) =
- let module O = Ominidom in
- print_string ("clicked: " ^
- (match node#get_name with
- | Some x -> x#get_string
- | None -> "no name"
- ) ^ "\n");
- flush stdout
+let clicked (mathview : GMathView.math_view) (element : Gdome.element) =
+ let module G = Gdome in
+ if not (jump element) then
+ match mathview#get_action with
+ Some n ->
+ mathview#action_toggle ;
+ print_string ("current action selection: " ^
+ string_of_int mathview#action_get_selected ^ "\n") ;
+ flush stdout ;
+ | None ->
+ print_string ("mouse is on: " ^
+ (match (mathview#get_element : Gdome.element option) with
+ Some e -> e#get_tagName#to_string
+ | None -> "NO ELEMENT!\n"
+ ) ^ "\n") ;
+ print_endline ("clicked: " ^ element#get_tagName#to_string) ;
+ flush stdout