]> matita.cs.unibo.it Git - helm.git/commitdiff
The sequent window now always scroll to the bottom when its content changes.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 14 Jan 2011 14:15:00 +0000 (14:15 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 14 Jan 2011 14:15:00 +0000 (14:15 +0000)
matita/matita/matitaMathView.ml

index 455d037b9b4b6e1a625ff141e9d1c117da395ff7..723170fa50812cc9b510b21c6e3ab0fc07348d72 100644 (file)
@@ -111,16 +111,21 @@ class sequentsViewer ~(notebook:GPack.notebook) ~(cicMathView:cicMathView) () =
         in
         let reparent () =
           scrolledWin <- Some w;
-          match cicMathView#misc#parent with
-          | None -> w#add cicMathView#coerce
-          | Some parent ->
-             let parent =
-              match cicMathView#misc#parent with
-                 None -> assert false
-               | Some p -> GContainer.cast_container p
-             in
-              parent#remove cicMathView#coerce;
-              w#add cicMathView#coerce
+          (match cicMathView#misc#parent with
+            | None -> ()
+            | Some parent ->
+               let parent =
+                match cicMathView#misc#parent with
+                   None -> assert false
+                 | Some p -> GContainer.cast_container p
+               in
+                parent#remove cicMathView#coerce);
+          w#add cicMathView#coerce;
+          ignore (w#vadjustment#set_value
+           (w#vadjustment#upper -. w#vadjustment#page_size));
+          ignore (w#vadjustment#connect#changed (fun _ ->
+            w#vadjustment#set_value
+             (w#vadjustment#upper -. w#vadjustment#page_size)))
         in
         goal2win <- (goal_switch, reparent) :: goal2win;
         w#coerce