Index: fittingview/src/sans/perspectives/fitting/fitting.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/fitting.py	(revision bca2cb97f0dadbbd24cf00e5c75de2635055dc50)
+++ fittingview/src/sans/perspectives/fitting/fitting.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -41,4 +41,5 @@
 from sans.perspectives.calculator.model_editor import TextDialog
 from sans.perspectives.calculator.model_editor import EditorWindow
+from sans.guiframe.gui_manager import MDIFrame
 
 MAX_NBR_DATA = 4
@@ -427,5 +428,5 @@
             page.Refresh()
             page.SetFocus()
-            self.parent._mgr.Update()
+            #self.parent._mgr.Update()
             msg = "%s already opened\n" % str(page.window_caption)
             wx.PostEvent(self.parent, StatusEvent(status=msg))
@@ -500,5 +501,8 @@
         #self.parent.Bind(EVT_FITSTATE_UPDATE, self.on_set_state_helper)
         # Creation of the fit panel
-        self.fit_panel = FitPanel(parent=self.parent, manager=self)
+        self.frame = MDIFrame(self.parent, None, 'None', (100, 200))
+        self.fit_panel = FitPanel(parent=self.frame, manager=self)
+        self.frame.set_panel(self.fit_panel)
+        self._frame_set_helper()
         self.on_add_new_page(event=None)
         #Set the manager for the main panel
@@ -513,5 +517,5 @@
         self.parent.Bind(EVT_SLICER_PANEL, self._on_slicer_event)
         self.parent.Bind(EVT_SLICER_PARS_UPDATE, self._onEVT_SLICER_PANEL)
-        self.parent._mgr.Bind(wx.aui.EVT_AUI_PANE_CLOSE,self._onclearslicer)
+        #self.parent._mgr.Bind(wx.aui.EVT_AUI_PANE_CLOSE,self._onclearslicer)
         #Create reader when fitting panel are created
         self.state_reader = Reader(self.set_state)
@@ -577,12 +581,4 @@
                 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error"))
     
-    def set_top_panel(self):
-        """
-        Close default (welcome) panel
-        """
-        if 'default' in self.parent.panels:
-            self.parent.on_close_welcome_panel()
-
-        
     def set_theory(self, theory_list=None):
         """
@@ -1168,5 +1164,4 @@
                 wx.PostEvent(self.parent, StatusEvent(status=msg,
                                                        info="warning"))
-            self.set_top_panel()
         except:
             msg = "Creating Fit page: %s"%sys.exc_value
@@ -1224,4 +1219,5 @@
             the panel and panel_name to find the slicer 's panel concerned.
         """
+        event.panel_name
         for item in self.parent.panels:
             name = event.panel_name
@@ -1229,5 +1225,5 @@
                 self.parent.panels[item].set_slicer(event.type, event.params)
                 
-        self.parent._mgr.Update()
+        #self.parent._mgr.Update()
    
     def _closed_fitpage(self, event):
@@ -1308,5 +1304,4 @@
                 data = plottable
                 self.add_fit_page(data=[data])
-        self.set_top_panel()
             
     def update_fit(self, result=None, msg=""):
@@ -1689,7 +1684,7 @@
             self.slicer_panels.append(event.panel)
             # Set group ID if available
-            event_id = self.parent.popup_panel(new_panel)
-            new_panel.uid = event_id
-            self.mypanels.append(new_panel)
+            event_id = self.parent.popup_panel(event.panel)
+            event.panel.uid = event_id
+            self.mypanels.append(event.panel)
        
     def _onclearslicer(self, event):
@@ -1697,6 +1692,6 @@
         Clear the boxslicer when close the panel associate with this slicer
         """
-        name = event.GetPane().caption
-    
+        name = event.GetEventObject().frame.GetTitle()
+        print "name", name
         for panel in self.slicer_panels:
             if panel.window_caption == name:
@@ -1706,5 +1701,5 @@
                         if self.parent.panels[item].uid == panel.base.uid:
                             self.parent.panels[item].onClearSlicer(event)
-                            self.parent._mgr.Update()
+                            #self.parent._mgr.Update()
                             break
                 break
