(* Callbacks *)
let jump node =
let module M = Minidom in
- print_string ("jump: " ^
- (match
- M.node_get_attribute_ns node
- (M.mDOMString_of_string "xlink")
- (M.mDOMString_of_string "href")
- with
- None -> "DOES NOT WORKS (if you have clicked on the hyperlink)!!!!!"
- | Some s -> M.string_of_mDOMString s
- ) ^ "\n");
print_string ("jump: " ^
(match
M.node_get_attribute node
let selection_changed node =
let module M = Minidom in
print_string ("selection_changed: " ^
- (match M.node_get_name node with
- None -> "selection_changed on nothing"
- | Some s -> "selection changed on " ^ M.string_of_mDOMString s
+ (match node with
+ None -> "selection_changed on nothing"
+ | Some node ->
+ match M.node_get_name node with
+ None -> "selection_changed on a node without name"
+ | Some s -> "selection changed on " ^ M.string_of_mDOMString s
) ^ "\n");
flush stdout
;;
let get_selection mathview () =
let selection =
-(* match !mathview#get_selection with
+ match !mathview#get_selection with
None -> "NO SELECTION"
| Some node ->
-*) let node = !mathview#get_selection in
match Minidom.node_get_name node with
None -> "selection is on nothing"
| Some s -> "selection is on " ^ Minidom.string_of_mDOMString s
let set_selection mathview () =
begin
try
-(* match !mathview#get_selection with
+ match !mathview#get_selection with
None -> raise Not_found
| Some node ->
-*) let node = !mathview#get_selection in
match Minidom.node_get_parent node with
None -> raise Not_found
| Some node ->
- !mathview#set_selection node ;
+ !mathview#set_selection (Some node) ;
print_string "set_selection: SEEMS TO WORK\n"
with
Not_found ->