]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/lablgtkmathview/gMathViewAux.ml
split into two major parts:
[helm.git] / helm / DEVEL / lablgtkmathview / gMathViewAux.ml
index 928e2196522e5981be0cc2efc98341de2a08dbcf..d59732cb25231dc13341890c894f589e7f6ee06f 100644 (file)
@@ -188,29 +188,10 @@ class single_selection_math_view obj =
   end
 ;;
 
-let single_selection_math_view ?adjustmenth ?adjustmentv ?font_size ?font_manager ?border_width
- ?width ?height ?packing ?show () =
- let w =
-   GtkMathView.MathView.create
-    ?adjustmenth:(Gaux.may_map ~f:GData.as_adjustment adjustmenth)
-    ?adjustmentv:(Gaux.may_map ~f:GData.as_adjustment adjustmentv)
-    ()
- in
-  GtkBase.Container.set w ?border_width ?width ?height;
-  let mathview =
-   GObj.pack_return (new single_selection_math_view w) ~packing ~show
-  in
-   begin
-     match font_size with
-     | Some size -> mathview#set_font_size size
-     | None      -> () 
-   end;
-   begin
-     match font_manager with
-     | Some manager -> mathview#set_font_manager_type ~fm_type:manager
-     | None         -> () 
-   end;
-   mathview
+let single_selection_math_view ?hadjustment ?vadjustment ?font_size ?log_verbosity =
+  GtkBase.Container.make_params ~cont:(
+  OgtkMathViewProps.pack_return
+    (fun p -> OgtkMathViewProps.set_params (new single_selection_math_view (GtkMathViewProps.MathView.create p)) ~font_size ~log_verbosity)) []
 ;;
 
 class multi_selection_math_view_signals obj
@@ -274,8 +255,6 @@ class multi_selection_math_view obj =
     ignore
      (self#connect#select_over
        (fun _ state ->
-         Printf.printf "stable selections: %d\n" (List.length selected) ;
-         Printf.printf "select_over with state: " ;
          let c = 
           function
              `SHIFT -> "shift "
@@ -291,7 +270,6 @@ class multi_selection_math_view obj =
     ignore
      (self#connect#select_end
        (fun _ state ->
-         Printf.printf "select_end\n" ; flush stdout ;
          if not (List.mem `CONTROL (Gdk.Convert.modifier state)) then
           self#remove_selections ;
          match root_selected with
@@ -304,26 +282,8 @@ class multi_selection_math_view obj =
    end
  ;;
 
-let multi_selection_math_view ?adjustmenth ?adjustmentv ?font_size ?font_manager ?border_width
- ?width ?height ?packing ?show () =
- let w =
-   GtkMathView.MathView.create
-    ?adjustmenth:(Gaux.may_map ~f:GData.as_adjustment adjustmenth)
-    ?adjustmentv:(Gaux.may_map ~f:GData.as_adjustment adjustmentv)
-    ()
- in
-  GtkBase.Container.set w ?border_width ?width ?height;
- let mathview = GObj.pack_return (new multi_selection_math_view w) ~packing ~show in
- begin
-    match font_size with
-    | Some size -> mathview#set_font_size size
-    | None      -> () 
-  end;
-  begin
-    match font_manager with
-    | Some manager -> mathview#set_font_manager_type ~fm_type:manager
-    | None         -> () 
-  end;
-  mathview
+let multi_selection_math_view ?hadjustment ?vadjustment ?font_size ?log_verbosity =
+  GtkBase.Container.make_params ~cont:(
+  OgtkMathViewProps.pack_return
+    (fun p -> OgtkMathViewProps.set_params (new multi_selection_math_view (GtkMathViewProps.MathView.create p)) ~font_size ~log_verbosity)) []
 ;;
-