]> matita.cs.unibo.it Git - helm.git/commitdiff
Bug solved: the #reparent method of Gtk should NOT be used:
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 26 Jul 2005 16:47:01 +0000 (16:47 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 26 Jul 2005 16:47:01 +0000 (16:47 +0000)
see http://www.gtk.org/faq/#AEN636.
This solves the flickering problem that occurred when a new tab was selected.

helm/matita/matitaMathView.ml

index b9affc23645e4d65ad8df81cfb306a85a7d53765..ee18823f5ba617953af6f971e8c5f21529bb8381 100644 (file)
@@ -277,6 +277,7 @@ 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
@@ -285,8 +286,13 @@ class sequentsViewer ~(notebook:GPack.notebook)
         let reparent () =
           scrolledWin <- Some w;
           match sequentViewer#misc#parent with
-          | None -> w#add sequentViewer#coerce
-          | Some _ -> sequentViewer#misc#reparent w#coerce
+          | None -> w#add sequentViewer#coerce; parentref := Some w
+          | 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;
         in
         goal2win <- (metano, reparent) :: goal2win;
         w#coerce