]> matita.cs.unibo.it Git - helm.git/commitdiff
Code simplification.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 28 Jul 2005 08:44:22 +0000 (08:44 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 28 Jul 2005 08:44:22 +0000 (08:44 +0000)
helm/matita/matitaMathView.ml

index 3b9d0282319cafa3d955aba9dffe90f9f3351b7c..07233700a29f15ae43da3e8f223f3652a18c39b4 100644 (file)
@@ -316,7 +316,6 @@ class sequentsViewer ~(notebook:GPack.notebook)
       _metasenv <- metasenv;
       pages <- sequents_no;
       self#script#setGoal goal;
-      let parentref = ref None in
       let win metano =
         let w =
           GBin.scrolled_window ~hpolicy:`AUTOMATIC ~vpolicy:`AUTOMATIC
@@ -325,13 +324,15 @@ class sequentsViewer ~(notebook:GPack.notebook)
         let reparent () =
           scrolledWin <- Some w;
           match sequentViewer#misc#parent with
-          | None -> w#add sequentViewer#coerce; parentref := Some w
+          | None -> w#add sequentViewer#coerce
           | Some parent ->
              let parent =
-              match !parentref with None -> assert false | Some p -> p in
-             parent#remove sequentViewer#coerce;
-             w#add sequentViewer#coerce;
-             parentref := Some w;
+              match sequentViewer#misc#parent with
+                 None -> assert false
+               | Some p -> GContainer.cast_container p
+             in
+              parent#remove sequentViewer#coerce;
+              w#add sequentViewer#coerce
         in
         goal2win <- (metano, reparent) :: goal2win;
         w#coerce