]> matita.cs.unibo.it Git - helm.git/commitdiff
Stupid bug fixed (introduced a couple of commits ago): the close button for
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 11 Jan 2011 21:18:17 +0000 (21:18 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 11 Jan 2011 21:18:17 +0000 (21:18 +0000)
tabs always closed the first tab instead of the right one.

matita/matita/matitaGui.ml

index 71e7c2c00ebe275dafc20145b0845e8284833a9a..63d0f999b557b8a96472b2d31f219ade53f9e01f 100644 (file)
@@ -971,20 +971,19 @@ class gui () =
     method private newScript () = 
        let scrolledWindow = GBin.scrolled_window () in
        let hbox = GPack.hbox () in
-       let tab_label = GMisc.label ~text:"foo"
-        ~packing:hbox#pack () in
+       let tab_label = GMisc.label ~text:"foo" ~packing:hbox#pack () in
        let _ =
         GMisc.label ~text:"" ~packing:(hbox#pack ~expand:true ~fill:true) () in
        let closebutton =
         GButton.button ~relief:`NONE ~packing:hbox#pack () in
-       let image =
-        GMisc.image ~stock:`CLOSE ~icon_size:`MENU () in
+       let image = GMisc.image ~stock:`CLOSE ~icon_size:`MENU () in
        closebutton#set_image image#coerce;
        let script = MatitaScript.script ~parent:scrolledWindow ~tab_label () in
         ignore (main#scriptNotebook#prepend_page ~tab_label:hbox#coerce
          scrolledWindow#coerce);
         ignore (closebutton#connect#clicked (fun () ->
-           self#closeScript (main#scriptNotebook#page_num hbox#coerce) script));
+         self#closeScript
+          (main#scriptNotebook#page_num scrolledWindow#coerce) script));
         main#scriptNotebook#goto_page 0;
         sequents_viewer#reset;
         sequents_viewer#load_logo;