Index: calculatorview/src/sans/perspectives/calculator/calculator.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/calculator.py	(revision 3e001f98892a6dd98b2b904148628e4df8c63238)
+++ calculatorview/src/sans/perspectives/calculator/calculator.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -12,7 +12,18 @@
 ################################################################################
 
-
+import wx
 from sans.guiframe.plugin_base import PluginBase
 from sans.perspectives.calculator.data_operator import DataOperatorWindow
+from sans.perspectives.calculator.data_editor import DataEditorWindow
+from sans.perspectives.calculator.kiessig_calculator_panel import KiessigWindow
+from sans.perspectives.calculator.sld_panel import SldWindow
+from sans.perspectives.calculator.density_panel import DensityWindow
+from sans.perspectives.calculator.slit_length_calculator_panel \
+            import SlitLengthCalculatorWindow
+from sans.perspectives.calculator.resolution_calculator_panel \
+            import ResolutionWindow
+from sans.perspectives.calculator.gen_scatter_panel import SasGenWindow
+from sans.perspectives.calculator.image_viewer import ImageView
+from sans.perspectives.calculator.pyconsole import PyConsole
 import logging
 
@@ -27,6 +38,16 @@
         logging.info("Calculator plug-in started")   
         self.sub_menu = "Tool" 
+        self.data_edit_frame = None
         # data operator use one frame all the time
         self.data_operator_frame = None
+        self.kiessig_frame = None
+        self.sld_frame = None
+        self.cal_md_frame = None
+        self.cal_slit_frame = None
+        self.cal_res_frame = None
+        self.gen_frame = None
+        self.image_view = None
+        self.py_frame = None
+        
         
     def help(self, evt):
@@ -88,9 +109,11 @@
         Edit meta data 
         """
-        from sans.perspectives.calculator.data_editor import DataEditorWindow
-        frame = DataEditorWindow(parent=self.parent, data=[],
-                                  title="Data Editor")
-        self.put_icon(frame)
-        frame.Show(True)
+        if self.data_edit_frame == None:
+            self.data_edit_frame = DataEditorWindow(parent=self.parent, 
+                                                    manager=self, data=[],
+                                                    title="Data Editor")
+            self.put_icon(self.data_edit_frame)
+        self.data_edit_frame.Show(False)    
+        self.data_edit_frame.Show(True)
               
     def on_data_operation(self, event):
@@ -101,4 +124,5 @@
             # Use one frame all the time
             self.data_operator_frame = DataOperatorWindow(parent=self.parent, 
+                                                manager=self, 
                                                 title="Data Operation")
             self.put_icon(self.data_operator_frame)
@@ -111,18 +135,21 @@
         Compute the Kiessig thickness
         """
-        from sans.perspectives.calculator.kiessig_calculator_panel \
-        import KiessigWindow
-        frame = KiessigWindow()
-        self.put_icon(frame)
-        frame.Show(True) 
-    
+        if self.kiessig_frame == None:
+            frame = KiessigWindow(parent=self.parent, manager=self)
+            self.put_icon(frame)
+            self.kiessig_frame = frame
+        self.kiessig_frame.Show(False)
+        self.kiessig_frame.Show(True) 
+        
     def on_calculate_sld(self, event):
         """
         Compute the scattering length density of molecula
         """
-        from sans.perspectives.calculator.sld_panel import SldWindow
-        frame = SldWindow(base=self.parent)
-        self.put_icon(frame)
-        frame.Show(True) 
+        if self.sld_frame == None:
+            frame = SldWindow(base=self.parent, manager=self)
+            self.put_icon(frame)
+            self.sld_frame = frame
+        self.sld_frame.Show(False)
+        self.sld_frame.Show(True) 
     
     def on_calculate_dv(self, event):
@@ -130,8 +157,10 @@
         Compute the mass density or molar voulme
         """
-        from sans.perspectives.calculator.density_panel import DensityWindow
-        frame = DensityWindow(base=self.parent)
-        self.put_icon(frame)
-        frame.Show(True) 
+        if self.cal_md_frame == None:
+            frame = DensityWindow(base=self.parent, manager=self)
+            self.put_icon(frame)
+            self.cal_md_frame = frame
+        self.cal_md_frame.Show(False)
+        self.cal_md_frame.Show(True) 
               
     def on_calculate_slit_size(self, event):
@@ -139,9 +168,10 @@
         Compute the slit size a given data
         """
-        from sans.perspectives.calculator.slit_length_calculator_panel \
-        import SlitLengthCalculatorWindow
-        frame = SlitLengthCalculatorWindow(parent=self.parent)  
-        self.put_icon(frame)  
-        frame.Show(True)
+        if self.cal_slit_frame == None:
+            frame = SlitLengthCalculatorWindow(parent=self.parent, manager=self)  
+            self.put_icon(frame)
+            self.cal_slit_frame = frame 
+        self.cal_slit_frame.Show(False)     
+        self.cal_slit_frame.Show(True)
         
     def on_calculate_resoltuion(self, event):
@@ -149,9 +179,10 @@
         Estimate the instrumental resolution
         """
-        from sans.perspectives.calculator.resolution_calculator_panel \
-        import ResolutionWindow
-        frame = ResolutionWindow(parent=self.parent)
-        self.put_icon(frame)
-        frame.Show(True) 
+        if self.cal_res_frame == None:
+            frame = ResolutionWindow(parent=self.parent, manager=self)
+            self.put_icon(frame)
+            self.cal_res_frame = frame
+        self.cal_res_frame.Show(False)
+        self.cal_res_frame.Show(True) 
         
     def on_gen_model(self, event):
@@ -159,9 +190,10 @@
         On Generic model menu event
         """
-        from sans.perspectives.calculator.gen_scatter_panel \
-        import SasGenWindow
-        frame = SasGenWindow(parent=self.parent)
-        self.put_icon(frame)
-        frame.Show(True) 
+        if self.gen_frame == None:
+            frame = SasGenWindow(parent=self.parent, manager=self)
+            self.put_icon(frame)
+            self.gen_frame = frame
+        self.gen_frame.Show(False)
+        self.gen_frame.Show(True) 
 
     def on_image_viewer(self, event):
@@ -171,7 +203,6 @@
         :param event: menu event
         """
-        from sans.perspectives.calculator.image_viewer import ImageView
-        image_view = ImageView(parent=self.parent)
-        image_view.load()
+        self.image_view = ImageView(parent=self.parent)
+        self.image_view.load()
         
     def on_python_console(self, event):
@@ -189,8 +220,11 @@
         :param filename: file name to open in editor
         """
-        from sans.perspectives.calculator.pyconsole import PyConsole
-        frame = PyConsole(parent=self.parent, filename=filename)
-        self.put_icon(frame)
-        frame.Show(True) 
+        if self.py_frame == None:
+            frame = PyConsole(parent=self.parent, base=self, 
+                              filename=filename)
+            self.put_icon(frame)
+            self.py_frame = frame
+        self.py_frame.Show(False)
+        self.py_frame.Show(True) 
         
     def put_icon(self, frame):
Index: calculatorview/src/sans/perspectives/calculator/data_editor.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/data_editor.py	(revision 7c720e99d53af8aacf128eb9a5332c89faced397)
+++ calculatorview/src/sans/perspectives/calculator/data_editor.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -636,8 +636,9 @@
         
 class DataEditorWindow(wx.Frame):
-    def __init__(self, parent, data=None, *args, **kwds):
+    def __init__(self, parent, manager, data=None, *args, **kwds):
         kwds["size"] = (PANEL_WIDTH, PANEL_HEIGTH)
         wx.Frame.__init__(self, parent, *args, **kwds)
         self.parent = parent
+        self.manager = manager
         self.panel = DataEditorPanel(parent=self, data=data)
         self.Show()
Index: calculatorview/src/sans/perspectives/calculator/data_operator.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/data_operator.py	(revision 657e52c6e801e630d2fc6f1722a752b701d20771)
+++ calculatorview/src/sans/perspectives/calculator/data_operator.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -615,4 +615,13 @@
         event.Skip()
     
+    def disconnect_panels(self):
+        """
+        """
+        self.out_pic.connect.disconnect()
+        self.equal_pic.connect.disconnect()
+        self.data1_pic.connect.disconnect()
+        self.operator_pic.connect.disconnect()
+        self.data2_pic.connect.disconnect()
+    
     def on_close(self, event):
         """
@@ -926,8 +935,9 @@
         
 class DataOperatorWindow(wx.Frame):
-    def __init__(self, parent, *args, **kwds):
+    def __init__(self, parent, manager, *args, **kwds):
         kwds["size"] = (PANEL_WIDTH, PANEL_HEIGTH)
         wx.Frame.__init__(self, parent, *args, **kwds)
         self.parent = parent
+        self.manager = manager
         self.panel = DataOperPanel(parent=self)
         wx.EVT_CLOSE(self, self.OnClose)
@@ -939,5 +949,8 @@
         On close event
         """
-        self.Show(False)
+        if self.manager != None:
+            self.manager.data_operator_frame = None
+        self.panel.disconnect_panels()
+        self.Destroy()
 
         
Index: calculatorview/src/sans/perspectives/calculator/density_panel.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/density_panel.py	(revision 0efca364ceb52dc3515d1acc2bd9b627bc56eb7c)
+++ calculatorview/src/sans/perspectives/calculator/density_panel.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -375,5 +375,6 @@
     """
     def __init__(self, parent=None, title="Density/Volume Calculator",
-                  base=None, size=(PANEL_SIZE, PANEL_SIZE/1.7), *args, **kwds):
+                  base=None, manager=None, 
+                  size=(PANEL_SIZE, PANEL_SIZE/1.7), *args, **kwds):
         """
         """
@@ -383,7 +384,18 @@
         """
         """
+        self.manager = manager
         self.panel = DensityPanel(self, base=base)
+        self.Bind(wx.EVT_CLOSE, self.on_close)
         self.Centre()
         self.Show(True)
+    
+    def on_close(self, event):
+        """
+        On close event
+        """
+        if self.manager != None:
+            self.manager.cal_md_frame = None
+        self.Destroy()
+        
         
 class ViewApp(wx.App):
Index: calculatorview/src/sans/perspectives/calculator/gen_scatter_panel.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/gen_scatter_panel.py	(revision d4895dd823bdece5cc00ec6124bacd627f79b1ad)
+++ calculatorview/src/sans/perspectives/calculator/gen_scatter_panel.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -19,4 +19,5 @@
 matplotlib.use('WXAgg')
 
+#from sans.guiframe.gui_manager import MDIFrame
 from data_util.calcthread import CalcThread
 from sans.guiframe.local_perspectives.plotting.SimplePlot import PlotFrame
@@ -1113,5 +1114,5 @@
         num_graph = str(self.graph_num)
         wx.CallAfter(self.parent.draw_graph, new_plot, 
-                     title="Graph %s: "% num_graph + new_plot.id )
+                     title="GEN Graph %s: "% num_graph + new_plot.id )
         self.graph_num += 1
                 
@@ -1172,7 +1173,7 @@
         num_graph = str(self.graph_num)
         wx.CallAfter(self.parent.draw_graph, new_plot, 
-                     title="Graph %s: "% num_graph + new_plot.id )
+                     title="GEN Graph %s: "% num_graph + new_plot.id )
         self.graph_num += 1
-        
+         
     def set_scale2d(self, scale):
         """
@@ -1794,5 +1795,5 @@
     GEN SAS main window
     """
-    def __init__(self, parent=None, title="Generic Scattering Calculator",
+    def __init__(self, parent=None, manager= None, title="Generic Scattering Calculator",
                 size=(PANEL_WIDTH * 1.3, PANEL_HEIGHT * 1.65), *args, **kwds):
         """
@@ -1804,4 +1805,5 @@
         wx.Frame.__init__(self, parent, *args, **kwds)
         self.parent = parent
+        self.base = manager
         self.omfpanel = OmfPanel(parent=self)
         self.panel = SasGenPanel(parent=self)
@@ -1815,7 +1817,7 @@
         self._plot_title = ''
         self.scale2d = 'log_{10}'
+        self.Bind(wx.EVT_CLOSE, self.on_close)
         
         self._build_toolbar()
-        self._build_menubar()
         
         self.build_panels()
@@ -2008,5 +2010,11 @@
         frame.Show(True)
         frame.SetFocus()
-    
+
+    def set_schedule_full_draw(self, panel=None, func='del'):  
+        """
+        Send full draw to gui frame
+        """
+        self.parent.set_schedule_full_draw(panel, func)
+        
     def get_npix(self):
         """
@@ -2082,4 +2090,6 @@
         Close
         """
+        if self.base != None:
+            self.base.gen_frame = None
         self.Destroy()
         
Index: calculatorview/src/sans/perspectives/calculator/image_viewer.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/image_viewer.py	(revision 3e001f98892a6dd98b2b904148628e4df8c63238)
+++ calculatorview/src/sans/perspectives/calculator/image_viewer.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -70,4 +70,6 @@
                     parent.put_icon(plot_frame)
             except:
+                print "parent", parent
+                raise
                 err_msg += "Failed to load '%s'.\n"% basename
         if err_msg:
Index: calculatorview/src/sans/perspectives/calculator/kiessig_calculator_panel.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/kiessig_calculator_panel.py	(revision 7d45a560fc54369038cd457bd4c8f382c01d9367)
+++ calculatorview/src/sans/perspectives/calculator/kiessig_calculator_panel.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -191,13 +191,25 @@
              
 class KiessigWindow(wx.Frame):
-    def __init__(self, parent=None, title="Kiessig Thickness Calculator",
-                  size=(PANEL_WIDTH,PANEL_HEIGHT), *args, **kwds):
+    def __init__(self, parent=None, manager=None, 
+                 title="Kiessig Thickness Calculator",
+                 size=(PANEL_WIDTH,PANEL_HEIGHT), *args, **kwds):
         kwds['title'] = title
         kwds['size'] = size
         wx.Frame.__init__(self, parent, *args, **kwds)
         self.parent = parent
+        self.manager = manager
         self.panel = KiessigThicknessCalculatorPanel(parent=self)
+        self.Bind(wx.EVT_CLOSE, self.on_close)
         self.Centre()
         self.Show(True)
+        
+    def on_close(self, event):
+        """
+        Close event
+        """
+        if self.manager != None:
+            self.manager.kiessig_frame = None
+        self.Destroy()
+
         
 if __name__ == "__main__": 
Index: calculatorview/src/sans/perspectives/calculator/pyconsole.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/pyconsole.py	(revision f706e09c74c801c19ed4aba69c4f0f353d282434)
+++ calculatorview/src/sans/perspectives/calculator/pyconsole.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -40,5 +40,5 @@
     ## Flag to tell the AUI manager to put this panel in the center pane
     CENTER_PANE = False
-    def __init__(self, parent=None, manager=None, panel=None,
+    def __init__(self, parent=None, base=None, manager=None, panel=None,
                     title='Python Shell/Editor', filename=None,
                     size=(PANEL_WIDTH, PANEL_HEIGHT)):
@@ -49,4 +49,5 @@
         self.parent = parent
         self._manager = manager
+        self.base = base
         self.panel = panel
         self._add_menu()
@@ -68,4 +69,5 @@
         self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateCompileMenu, id=ID_COMPILE)
         self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateCompileMenu, id=ID_RUN)
+        self.Bind(wx.EVT_CLOSE, self.on_close)
         if not title.count('Python Shell'):
             # Delete menu item (open and new) if not python shell
@@ -293,4 +295,12 @@
             event.Enable(False)
             
+    def on_close(self, event):
+        """
+        Close event
+        """
+        if self.base != None:
+            self.base.py_frame = None
+        self.Destroy()
+                    
 ABOUT =  "Welcome to Python %s! \n\n"% sys.version.split()[0]
 ABOUT += "This uses Py Shell/Editor in wx (developed by Patrick K. O'Brien).\n"
Index: calculatorview/src/sans/perspectives/calculator/resolution_calculator_panel.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/resolution_calculator_panel.py	(revision e95614e66b49c5278e46796a861486dc9f8f0ee4)
+++ calculatorview/src/sans/perspectives/calculator/resolution_calculator_panel.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -1393,14 +1393,16 @@
     Resolution Window
     """
-    def __init__(self, parent = None, title = "SANS Resolution Estimator",
-                  size=(PANEL_WIDTH * 2, PANEL_HEIGHT), *args, **kwds):
+    def __init__(self, parent = None, manager=None, 
+                 title = "SANS Resolution Estimator",
+                 size=(PANEL_WIDTH * 2, PANEL_HEIGHT), *args, **kwds):
         kwds['title'] = title
         kwds['size'] = size
         wx.Frame.__init__(self, parent=None, *args, **kwds)
         self.parent = parent
+        self.manager = manager
         self.panel = ResolutionCalculatorPanel(parent=self)
+        self.Bind(wx.EVT_CLOSE, self.OnClose)
         self.Centre()
         self.Show(True)
-        wx.EVT_CLOSE(self, self.OnClose)
     
     def OnClose(self, event):  
@@ -1409,5 +1411,7 @@
         """
         _pylab_helpers.Gcf.figs = {}
-        self.Destroy()  
+        if self.manager != None:
+            self.manager.cal_res_frame = None
+        self.Destroy() 
 
         
Index: calculatorview/src/sans/perspectives/calculator/sld_panel.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/sld_panel.py	(revision 9c30b8c96a831d3f9e30545f6b5cac70bdeb5189)
+++ calculatorview/src/sans/perspectives/calculator/sld_panel.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -441,5 +441,6 @@
     """
     def __init__(self, parent=None, title="SLD Calculator",
-                  base=None, size=(PANEL_SIZE, PANEL_SIZE), *args, **kwds):
+                  base=None, manager=None, 
+                  size=(PANEL_SIZE, PANEL_SIZE), *args, **kwds):
         """
         """
@@ -449,7 +450,20 @@
         """
         """
+        self.parent = parent
+        self.base = base
+        self.manager = manager
         self.panel = SldPanel(self, base=base)
+        self.Bind(wx.EVT_CLOSE, self.on_close)
         self.Centre()
         self.Show(True)
+    
+    def on_close(self, event):
+        """
+        On close event
+        """
+        if self.manager != None:
+            self.manager.sld_frame = None
+        self.Destroy()
+        
         
 class ViewApp(wx.App):
Index: calculatorview/src/sans/perspectives/calculator/slit_length_calculator_panel.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/slit_length_calculator_panel.py	(revision 29a90b05afde5f2e18759d72b01faa1e0cd1659d)
+++ calculatorview/src/sans/perspectives/calculator/slit_length_calculator_panel.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -254,5 +254,5 @@
     """
     """
-    def __init__(self, parent=None, title="Slit Size Calculator",
+    def __init__(self, parent=None, manager=None, title="Slit Size Calculator",
                 size=(PANEL_WIDTH,PANEL_HEIGHT), *args, **kwds):
         """
@@ -262,7 +262,17 @@
         wx.Frame.__init__(self, parent, *args, **kwds)
         self.parent = parent
+        self.manager = manager
         self.panel = SlitLengthCalculatorPanel(parent=self)
+        self.Bind(wx.EVT_CLOSE, self.on_close)
         self.Centre()
         self.Show(True)
+
+    def on_close(self, event):
+        """
+        Close event
+        """
+        if self.manager != None:
+            self.manager.cal_slit_frame = None
+        self.Destroy()
         
 if __name__ == "__main__": 
