]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/lablgtk_gtkmathview/lablgtk-20000829_gtkmathview-0.2.0/test/test.ml
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / DEVEL / lablgtk_gtkmathview / lablgtk-20000829_gtkmathview-0.2.0 / test / test.ml
index 4f9af18e55a346b4599efa879e4b1f6ba311248d..af65d7485db1b7f3ac27a9175a839177689f385a 100644 (file)
@@ -9,15 +9,6 @@
 (* 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
@@ -32,9 +23,12 @@ let jump 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
 ;;
@@ -70,10 +64,9 @@ let load mathview () =
 
 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
@@ -85,14 +78,13 @@ let get_selection mathview () =
 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 ->