Index: invariantview/perspectives/invariant/invariant.py
===================================================================
--- invariantview/perspectives/invariant/invariant.py	(revision 75fbd1798f95ec58502a817f7435b1dfae03b69f)
+++ invariantview/perspectives/invariant/invariant.py	(revision cb69775e79a5b088ed99e66e533531920663e659)
@@ -215,4 +215,7 @@
             
             
+    def clear_panel(self):
+        self.invariant_panel.clear_panel()
+        
     def compute_helper(self, data):
         """
@@ -256,4 +259,6 @@
             if datainfo.__class__.__name__ == 'list':
                 data = datainfo[0]
+            else:
+                data = datainfo
             if data is None:
                 msg = "invariant.set_state: datainfo parameter cannot"
@@ -265,5 +270,5 @@
             data.name = name
             data.filename = name
-            #datainfo = self.parent.create_gui_data(datainfo,None)
+            data = self.parent.create_gui_data(data,None)
             #self.__data = datainfo
             #self.__data.group_id = data.filename
@@ -273,5 +278,5 @@
                                         reset=True, title=self.__data.title))
             #temp_state = copy.deepcopy(state)
-            temp_state = self.state_reader.get_state()
+            #temp_state = self.state_reader.get_state()
             # set state
             self.invariant_panel.is_state_data = True
@@ -281,6 +286,6 @@
             self.on_perspective(event=None)
             # Load the invariant states
-            self.temp_state = temp_state
-            self.invariant_panel.set_state(state=temp_state,data=self.__data)         
+            self.temp_state = state
+            self.invariant_panel.set_state(state=state,data=self.__data)         
            
         except: 
Index: invariantview/perspectives/invariant/invariant_panel.py
===================================================================
--- invariantview/perspectives/invariant/invariant_panel.py	(revision 27f3831d873b892f6463e9312426563f00511d5d)
+++ invariantview/perspectives/invariant/invariant_panel.py	(revision cb69775e79a5b088ed99e66e533531920663e659)
@@ -13,4 +13,5 @@
 from sans.guiframe.utils import check_float
 from sans.guiframe.events import StatusEvent
+from sans.guiframe.events import AppendBookmarkEvent
 from .invariant_details import InvariantDetailsPanel
 from .invariant_details import InvariantContainer
@@ -80,5 +81,5 @@
         self.bookmark_num = 0
         
-        self._set_bookmark_menu()
+        #self._set_bookmark_menu()
         #Init state
         self.set_state()
@@ -101,23 +102,6 @@
         ## Default file location for save
         self._default_save_location = os.getcwd()
-        
-    def err_check_on_data(self):
-        """
-        Check if data is valid for further computation
-        """
-        flag = False
-        self.hint_msg_txt.SetLabel('')
-        #edit the panel
-        if self._data is not None:
-            if len(self._data.x[self._data.x==0]) > 0:
-                flag = True
-                msg = "Invariant: one of your q-values is zero. "
-                msg += "Delete that entry before proceeding"
-                self.hint_msg_txt.SetLabel(msg)
-                wx.PostEvent(self.parent, StatusEvent(status=msg,
-                                                      info="warning",
-                                                      type="stop")) 
-        return flag
-    
+        self._set_bookmark_flag(False)
+        
     def get_data(self):
         """
@@ -137,5 +121,4 @@
         #edit the panel
         if self._data is not None:
-            self.err_check_on_data()
             self.get_state_by_num(0)
             data_name = self._data.name
@@ -196,8 +179,6 @@
             num = self.state.saved_state['state_num']
             if num > 0 :
-                self._undo_enable()
                 self._set_undo_flag(True)
             if num < len(state.state_list) - 1:
-                self._redo_enable()
                 self._set_redo_flag(True)
                 
@@ -225,28 +206,28 @@
             self.is_state_data = False
 
-    def clear_panel(self, format='.svs'):
+    def clear_panel(self):
         """
         Clear panel to defaults, used by set_state of manager
         """
-        if format == '.svs':
-            self._data = None
-            # default data testctrl
-            self.hint_msg_txt.SetLabel('')
-            data_name = ''
-            data_qmin = ''
-            data_qmax = ''
-            self.data_name_tcl.SetValue(str(data_name))
-            self.data_min_tcl.SetValue(str(data_qmin))
-            self.data_max_tcl.SetValue(str(data_qmax))
-            #reset output textctrl
-            self._reset_output()
-            #reset panel
-            self.reset_panel()
-            #reset state w/o data
-            self.set_state()
-            # default flags for state
-            self.new_state = False
-            self.is_state_data = False
-            self.is_power_out = False
+        
+        self._data = None
+        # default data testctrl
+        self.hint_msg_txt.SetLabel('')
+        data_name = ''
+        data_qmin = ''
+        data_qmax = ''
+        self.data_name_tcl.SetValue(str(data_name))
+        self.data_min_tcl.SetValue(str(data_qmin))
+        self.data_max_tcl.SetValue(str(data_qmax))
+        #reset output textctrl
+        self._reset_output()
+        #reset panel
+        self.reset_panel()
+        #reset state w/o data
+        self.set_state()
+        # default flags for state
+        self.new_state = False
+        self.is_state_data = False
+        self.is_power_out = False
 
     def get_background(self):
@@ -525,5 +506,4 @@
         elif event != None: 
             self._set_compute_state(state='compute')
-            self.button_bookmark.Enable(True)
             self._set_bookmark_flag(True)
             msg= "\n\nStarting a new invariant computation..."            
@@ -531,7 +511,7 @@
             
 
-        if self._data is None or self.err_check_on_data():
+        if self._data is None:
             return
-        
+        self.button_details.Enable()
         #clear outputs textctrl 
         self._reset_output()
@@ -625,13 +605,9 @@
 
         #enable the button_ok for more details
-        self.button_details.Enable()
+        self._set_preview_flag(True)
         
         if event != None: 
-            if not self.button_report.IsEnabled():
-                self.button_report.Enable(True)
-                self._set_preview_flag(True)
-            if not self.button_save.IsEnabled():
-                self.button_save.Enable(True)
-                self._set_save_flag(True)
+            self._set_preview_flag(True)
+            self._set_save_flag(True)
             wx.PostEvent(self.parent,
                 StatusEvent(status='\nFinished invariant computation...'))
@@ -653,11 +629,7 @@
         
         if float(pre_state_num) <= 0:
-            self._undo_disable()
             self._set_undo_flag(False)
         else:
-            self._undo_enable()
             self._set_undo_flag(True)
-
-        self._redo_enable()
         self._set_redo_flag(True)
         self.is_power_out = False  
@@ -680,11 +652,8 @@
         
         if float(next_state_num)+2 > len(self.state.state_list):
-            self._redo_disable()
             self._set_redo_flag(False)
         else:
-            self._redo_enable()
-            self._set_redo_flag(FTrue)
-        
-        self._undo_enable()
+            self._set_redo_flag(True)
+    
         self._set_undo_flag(True)
         self.is_power_out = False
@@ -830,13 +799,8 @@
         self._enable_high_q_section()
         self._reset_output()
-        self.button_undo.Disable()
         self._set_undo_flag(False)
-        self.button_redo.Disable()
         self._set_redo_flag(False)
-        self.button_bookmark.Disable()
         self._set_bookmark_flag(False)
-        self.button_report.Disable()
         self._set_preview_flag(False)
-        self.button_save.Disable() 
         self._set_save_flag(False)
         self.button_calculate.SetFocus()
@@ -886,7 +850,5 @@
 
         event.Skip()
-        self._undo_enable()
         self._set_undo_flag(True)
-        self._redo_disable()
         self._set_redo_flag(False)
             
@@ -930,7 +892,5 @@
                 pass
         # Enable the undo button if it was not
-        self._undo_enable()
         self._set_undo_flag(True)
-        self._redo_disable()
         self._set_redo_flag(False)
         
@@ -961,5 +921,5 @@
         #copy.deepcopy(self.state.saved_state)
         self.state.state_list[str(self.state.state_num)] = self.state.clone_state()
-        self._undo_disable()
+        self._set_undo_flag(False)
         
     def _on_text(self, event):
@@ -1011,14 +971,9 @@
 
         event.Skip()
-        self._undo_enable()
         self._set_undo_flag(True)
-        self._redo_disable()
         self._set_redo_flag(False)
-        self.button_bookmark.Enable(True)
         self._set_bookmark_flag(True)
-        self.button_report.Disable()
         self._set_preview_flag(False)
        
-        
     def _on_out_text(self, event):     
         """
@@ -1087,10 +1042,10 @@
         msg +=" Right click on the panel to retrieve this state"
         #wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
-        name = "%d] bookmarked at %s on %s"%(self.bookmark_num,my_time, date)
+        name = "%d] bookmarked at %s on %s"%(self.bookmark_num, my_time, date)
         
         # append it to menu
-        id = wx.NewId()
-        self.popUpMenu.Append(id,name,str(msg))
-        wx.EVT_MENU(self, id, self._back_to_bookmark )
+        #id = wx.NewId()
+        #self.popUpMenu.Append(id,name,str(msg))
+        #wx.EVT_MENU(self, id, self._back_to_bookmark)
         state = self.state.clone_state()
         comp_state = copy.deepcopy(self.state.state_list[str(compute_num)])
@@ -1100,4 +1055,8 @@
         
         wx.PostEvent(self.parent,StatusEvent(status=msg,info="info"))
+        wx.PostEvent(self.parent, 
+                     AppendBookmarkEvent(title=name, 
+                                         hint=str(msg),
+                                          handler=self._back_to_bookmark))
 
     def _back_to_bookmark(self,event):
@@ -1107,10 +1066,13 @@
         and set it as a new state
         """
+        self._manager.on_perspective(event)
+        menu = event.GetEventObject()
         ## post help message for the selected model 
-        msg = self.popUpMenu.GetHelpString(event.GetId())
+        msg = menu.GetHelpString(event.GetId())
         msg +=" reloaded"
         wx.PostEvent(self.parent, StatusEvent(status = msg ))
         
-        name= self.popUpMenu.GetLabel(event.GetId())
+        name= menu.GetLabel(event.GetId())
+        
         num,time = name.split(']')
         current_state_num = self.state.state_num  
@@ -1122,5 +1084,5 @@
         self.state.state_list[str(state_num)] = self.state.clone_state()
         self.state.state_num = state_num
-        self._undo_enable()
+       
         self._set_undo_flag(True)
         self._info_bookmark_num(event)
@@ -1134,5 +1096,6 @@
         if event == None: return
         # get the object
-        item = self.popUpMenu.FindItemById(event.GetId())
+        menu = event.GetEventObject()
+        item = menu.FindItemById(event.GetId())
         text = item.GetText()
         num = text.split(']')[0]
@@ -1159,32 +1122,5 @@
         date= str( month)+"/"+str(day)+"/"+str(year)
         return my_time, date
-      
-    def _undo_enable(self):
-        """
-        Enable undo button
-        """
-        if not self.button_undo.IsEnabled():
-            self.button_undo.Enable(True)
-
-    def _undo_disable(self):
-        """
-        Disable undo button
-        """
-        if self.button_undo.IsEnabled():
-            self.button_undo.Disable()
-
-    def _redo_enable(self):
-        """
-        Enable redo button
-        """
-        if not self.button_redo.IsEnabled():
-            self.button_redo.Enable(True)
-
-    def _redo_disable(self):
-        """
-        Disable redo button
-        """
-        if self.button_redo.IsEnabled():
-            self.button_redo.Disable()
+   
             
     def on_save(self, evt=None): 
@@ -1303,7 +1239,6 @@
         """
         #Sizer hint 
-        hint_msg = "First open data file from 'File' menu."
-        hint_msg += "Then Highlight and right click on the data plot. \n"
-        hint_msg += "Finally, select 'Compute Invariant'."
+        hint_msg = ""
+        
         self.hint_msg_txt = wx.StaticText(self, -1, hint_msg)  
         self.hint_msg_txt.SetForegroundColour("red")
@@ -1393,10 +1328,7 @@
         """
         if event != None: 
-            self.button_bookmark.Enable(True)
             self._set_bookmark_flag(True)
-            self.button_report.Disable()
             self._set_preview_flag(False)
-            print "enable fit==>event!=None"
-
+    
         if self.fix_enable_low.IsEnabled():
             
@@ -1414,7 +1346,5 @@
         """
         if event != None: 
-            self.button_bookmark.Enable(True)
             self._set_bookmark_flag(True)
-            self.button_report.Disable()
             self._set_preview_flag(False)
             
@@ -1443,7 +1373,5 @@
         """
         if event != None: 
-            self.button_bookmark.Enable(True)
             self._set_bookmark_flag(True)
-            self.button_report.Disable()
             self._set_preview_flag(False)
         if self.guinier.GetValue():
@@ -1546,7 +1474,6 @@
         """
         if event != None: 
-            self.button_bookmark.Enable(True)
             self._set_bookmark_flag(True)
-            self.button_report.Disable()
+    
             self._set_preview_flag(False)
         if self.fix_enable_high.IsEnabled():
@@ -1564,7 +1491,5 @@
         """
         if event != None: 
-            self.button_bookmark.Enable(True)
             self._set_bookmark_flag(True)
-            self.button_report.Disable()
             self._set_preview_flag(False)
         if self.enable_high_cbox.GetValue():
@@ -1839,75 +1764,5 @@
                                    (self.button_details, 0 , wx.ALL, 10),
                         (self.button_calculate, 0 ,
-                         wx.RIGHT|wx.TOP|wx.BOTTOM, 10)])#,
-                                   #(self.button_undo, 0 , wx.ALL, 10),
-                                   #(self.button_redo, 0 , wx.ALL, 10)])
-    def _layout_save_button(self):  
-        """
-        Do the layout for the save button widgets
-        """ 
-        import sans.perspectives.invariant as inv
-
-        path = inv.get_data_path(media='media')
-        self.undo_png = os.path.join(path,"undo.png")
-        self.redo_png = os.path.join(path,"redo.png")
-        self.bookmark_png = os.path.join(path,"bookmark.png")
-        self.report_png = os.path.join(path,"report.png")
-        self.save_png = os.path.join(path,"save.png")
-        #undo button
-        id = wx.NewId()
-        #wx.Button(self, id, "Undo",size=(50,20))
-        self.button_undo = wx.BitmapButton(self, id,wx.Bitmap(self.undo_png))
-        self.button_undo.SetToolTipString("Undo")
-        
-        #self.button_undo.SetBackgroundColour('#c2e6f8')
-        self.Bind(wx.EVT_BUTTON, self.on_undo, id=id)
-        self._undo_disable()
-        #redo button
-        id = wx.NewId()
-        #wx.Button(self, id, "Redo",size=(50,20))
-        self.button_redo = wx.BitmapButton(self, id,wx.Bitmap(self.redo_png))
-        self.button_redo.SetToolTipString("Redo")
-        self.Bind(wx.EVT_BUTTON, self.on_redo, id=id)
-        self._redo_disable()   
-        self._set_redo_flag(False)
-        #bookmark button
-        id = wx.NewId()
-        #wx.Button(self, id, "Undo",size=(50,20))
-        self.button_bookmark = wx.BitmapButton(self, id,
-                                               wx.Bitmap(self.bookmark_png))
-        hint_msg = "Bookmark: right-click on the panel to retrieve it"
-        self.button_bookmark.SetToolTipString(hint_msg)
-        self.Bind(wx.EVT_BUTTON, self.on_bookmark, id=id)
-        #report button
-        id = wx.NewId()
-        #wx.Button(self, id, "Redo",size=(50,20))
-        self.button_report = wx.BitmapButton(self, id,
-                                             wx.Bitmap(self.report_png))
-        hint_msg = "Report the result of the computation"
-        self.button_report.SetToolTipString(hint_msg)
-        self.Bind(wx.EVT_BUTTON, self.on_preview, id=id)
-        #self.button_report.Disable()   
-        #self._set_preview_flag(False)   
-        #save button
-        id = wx.NewId()
-        #wx.Button(self, id, "Save", name ='Save_invariant' )
-        self.button_save = wx.BitmapButton(self, id, wx.Bitmap(self.save_png),
-                                           name='Save_invariant')
-        self.button_save.SetToolTipString("Save as a file")
-        self.Bind(wx.EVT_BUTTON, self.on_save, id=id)   
-        self.button_save.Disable()  
-        self._set_save_flag(False)
-        self.save_button_sizer.AddMany([((PANEL_WIDTH/2,20), 1 ,
-                                         wx.EXPAND|wx.ADJUST_MINSIZE,0),
-                                   (self.button_undo, 0 ,
-                                    wx.LEFT|wx.ADJUST_MINSIZE, 10),
-                                   (self.button_redo, 0 ,
-                                    wx.LEFT|wx.ADJUST_MINSIZE, 10),
-                                   (self.button_bookmark, 0 ,
-                                    wx.LEFT|wx.ADJUST_MINSIZE, 10),
-                                   (self.button_report, 0 ,
-                                    wx.LEFT|wx.ADJUST_MINSIZE, 10),
-                                   (self.button_save, 0 ,
-                                    wx.LEFT|wx.ADJUST_MINSIZE, 10)])        
+                         wx.RIGHT|wx.TOP|wx.BOTTOM, 10)])
     def _do_layout(self):
         """
@@ -1920,5 +1775,4 @@
         self._layout_outputs_sizer()
         self._layout_button()
-        self._layout_save_button()
         self.main_sizer.AddMany([(self.data_name_boxsizer,0, wx.ALL, 10),
                                   (self.outputs_sizer, 0,
@@ -1929,6 +1783,4 @@
                                   wx.LEFT|wx.RIGHT|wx.BOTTOM, 10),
                                   (self.extrapolation_sizer, 0,
-                                  wx.LEFT|wx.RIGHT|wx.BOTTOM, 10),\
-                                  (self.save_button_sizer,0,
                                   wx.LEFT|wx.RIGHT|wx.BOTTOM, 10)])
         self.SetSizer(self.main_sizer)
Index: invariantview/perspectives/invariant/invariant_state.py
===================================================================
--- invariantview/perspectives/invariant/invariant_state.py	(revision 75fbd1798f95ec58502a817f7435b1dfae03b69f)
+++ invariantview/perspectives/invariant/invariant_state.py	(revision cb69775e79a5b088ed99e66e533531920663e659)
@@ -208,5 +208,6 @@
                 # other outputs than Q*
                 name = item[0] + "_tcl"
-                exec "value = self.saved_state['%s']" % name
+                if name in self.saved_state.keys():
+                    exec "value = self.saved_state['%s']" % name
                 
             # Exclude the outputs w/''    
@@ -228,5 +229,6 @@
                                         format_number(value, high=True))
         # Include warning msg
-        state += "\n\nNote:\n" + self.container.warning_msg
+        if self.container is not None:
+            state += "\n\nNote:\n" + self.container.warning_msg
         return state
 
@@ -745,6 +747,6 @@
             # Call back to post the new state
             self.state = output[0].meta_data['invstate']
-            #self.call_back(state=output[0].meta_data['invstate'],
-            #               datainfo = output[0])
+            self.call_back(state=output[0].meta_data['invstate'],
+                          datainfo = output[0])
             return output[0]
         else:
