From: Claudio Sacerdoti Coen Date: Tue, 26 Jul 2005 16:47:01 +0000 (+0000) Subject: Bug solved: the #reparent method of Gtk should NOT be used: X-Git-Tag: V_0_7_2~59 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=f8bea0ecd5e7413e9e02c7adeb26cb19b17764ee;p=helm.git Bug solved: the #reparent method of Gtk should NOT be used: see http://www.gtk.org/faq/#AEN636. This solves the flickering problem that occurred when a new tab was selected. --- diff --git a/helm/matita/matitaMathView.ml b/helm/matita/matitaMathView.ml index b9affc236..ee18823f5 100644 --- a/helm/matita/matitaMathView.ml +++ b/helm/matita/matitaMathView.ml @@ -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