Index: sansview/perspectives/fitting/fitpage1D.py
===================================================================
--- sansview/perspectives/fitting/fitpage1D.py	(revision 693ab7864cacacb270961dc7225a0ec740e1958a)
+++ sansview/perspectives/fitting/fitpage1D.py	(revision 2dbb6812a796357379c72f2ee764a292e372784d)
@@ -135,7 +135,9 @@
         ix +=2
         self.sizer1.Add(self.btFit,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy+= 1
-        ix = 3
+        ix+= 1
         self.sizer1.Add( self.btClose,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix= 1
+        iy+=1
+        self.sizer1.Add((20,20),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         # contains link between  model ,all its parameters, and panel organization
         self.parameters=[]
@@ -183,7 +185,4 @@
             @return residuals
         """
-        print self.data.x
-        print self.data.y
-        print self.data.dy
         
         flag=self.checkFitRange()
@@ -293,5 +292,5 @@
         valueMax = self.xmax.GetValue()
         # Check for possible values entered
-        print "fitpage: checkfitrange:",valueMin,valueMax
+        #print "fitpage: checkfitrange:",valueMin,valueMax
         try:
             if (float(valueMax)> float(valueMin)):
@@ -341,4 +340,5 @@
         self.model = model
         keys = self.model.getParamList()
+        print "fitpage1D : dispersion list",self.model.getDispParamList()
         keys.sort()
         iy = 1
@@ -436,7 +436,8 @@
             for item in self.parameters:
                 try:
-                     name=str(item[0].GetLabelText())
-                     value= float(item[1].GetValue())
-                     self.model.setParam(name,value) 
+                     
+                    name=str(item[0].GetLabelText())
+                    value= float(item[1].GetValue())
+                    self.model.setParam(name,value) 
                 except:
                      wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\
Index: sansview/perspectives/fitting/fitpage2D.py
===================================================================
--- sansview/perspectives/fitting/fitpage2D.py	(revision 9d31a8b73e768aee2608c8a0172d85e8dae7f31a)
+++ sansview/perspectives/fitting/fitpage2D.py	(revision 2dbb6812a796357379c72f2ee764a292e372784d)
@@ -157,7 +157,9 @@
         ix +=2
         self.sizer1.Add(self.btFit,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        iy+= 1
-        ix = 3
+        ix+= 1
         self.sizer1.Add( self.btClose,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix= 1
+        iy+=1
+        self.sizer1.Add((20,20),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         # contains link between  model ,all its parameters, and panel organization
         self.parameters=[]
Index: sansview/perspectives/fitting/fitpanel.py
===================================================================
--- sansview/perspectives/fitting/fitpanel.py	(revision 693ab7864cacacb270961dc7225a0ec740e1958a)
+++ sansview/perspectives/fitting/fitpanel.py	(revision 2dbb6812a796357379c72f2ee764a292e372784d)
@@ -102,5 +102,5 @@
         if  page_title !=self.draw_model_name or self.draw_model_name ==None: 
             from modelpage import ModelPage
-            panel = ModelPage(self.nb,model,description, -1)
+            panel = ModelPage(self.nb,model, -1)
             panel.set_manager(self.manager)
             panel.set_owner(self.event_owner)
@@ -151,27 +151,29 @@
              selected on that page. remove its reference into page_finder (fitting module)
         """
-       
-        sim_page = self.nb.GetPage(0)
-        selected_page = self.nb.GetPage(self.nb.GetSelection())
-        
-        if sim_page != selected_page:
-            # remove the check box link to the model name of this page (selected_page)
-            sim_page.remove_model(selected_page)
-            #remove that page from page_finder of fitting module
-            page_finder=self.manager.get_page_finder() 
-            for page, value in page_finder.iteritems():
-                if page==selected_page:
-                    del page_finder[page]
-                    break
-            #Delete the page from notebook
-            page_number = self.nb.GetSelection()
-            if self.nb.GetPageText(page_number)== self.page_name:
-                self.draw_model_name=None
-                
-            selected_page.Destroy()
-            self.nb.RemovePage(page_number)
-            #self.name=None
-            self.fit_page_name=None
+        try:
+            sim_page = self.nb.GetPage(0)
+            selected_page = self.nb.GetPage(self.nb.GetSelection())
             
+            if sim_page != selected_page:
+                # remove the check box link to the model name of this page (selected_page)
+                sim_page.remove_model(selected_page)
+                #remove that page from page_finder of fitting module
+                page_finder=self.manager.get_page_finder() 
+                for page, value in page_finder.iteritems():
+                    if page==selected_page:
+                        del page_finder[page]
+                        break
+                #Delete the page from notebook
+                page_number = self.nb.GetSelection()
+                if self.nb.GetPageText(page_number)== self.page_name:
+                    self.draw_model_name=None
+                    
+                selected_page.Destroy()
+                self.nb.RemovePage(page_number)
+                #self.name=None
+                self.fit_page_name=None
+        except:
+            raise
+        print "fitpanel", self.draw_model_name 
     def set_model_list(self,dict):
          """ 
Index: sansview/perspectives/fitting/fitting.py
===================================================================
--- sansview/perspectives/fitting/fitting.py	(revision 693ab7864cacacb270961dc7225a0ec740e1958a)
+++ sansview/perspectives/fitting/fitting.py	(revision 2dbb6812a796357379c72f2ee764a292e372784d)
@@ -11,5 +11,5 @@
 from fitpanel import FitPanel
 
-import models
+import models,modelpage
 import fitpage1D,fitpage2D
 import park
@@ -60,4 +60,5 @@
         id2 = wx.NewId()
         owner.Bind(models.EVT_MODEL,self._on_model_menu)
+        #owner.Bind(modelpage.EVT_MODEL,self._on_model_menu)
         self.fit_panel.set_owner(owner)
         self.fit_panel.set_model_list(self.menu_mng.get_model_list())
@@ -84,9 +85,11 @@
         for item in graph.plottables:
             if item.__class__.__name__ is "Data2D":
-                return [["Fit Data2D", "Dialog with fitting parameters ", self._onSelect]] 
+                return [["Select data  for Fitting",\
+                          "Dialog with fitting parameters ", self._onSelect]] 
             else:
                 if item.name==graph.selected_plottable and\
                  item.__class__.__name__ is  "Data1D":
-                    return [["Fit Data1D", "Dialog with fitting parameters ", self._onSelect]] 
+                    return [["Select data  for Fitting", \
+                             "Dialog with fitting parameters ", self._onSelect]] 
         return []   
 
@@ -539,5 +542,5 @@
                 theory.image=model.runXY(data.image)
                 
-                print "fitting : plot_helper:",theory.image
+                #print "fitting : plot_helper:",theory.image
                 theory.zmin= data.zmin
                 theory.zmax= data.zmax
@@ -555,6 +558,7 @@
         """
         name="Model View"
-        model=evt.modelinfo.model()
-        description=evt.modelinfo.description
+        model=evt.model()
+        
+        description=model.description
         self.fit_panel.add_model_page(model,description,name)       
         self.draw_model(model)
@@ -573,5 +577,4 @@
             dy[i] = math.sqrt(math.fabs(y[i]))
         try:
-           
             new_plot = Theory1D(x, y)
             new_plot.name = "Model"
@@ -581,7 +584,5 @@
             wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Analytical model"))
         except:
-            wx.PostEvent(self.parent, StatusEvent(status="fitting \
-                        skipping point x %g %s" %(qmax, sys.exc_value)))
-
+            raise
 if __name__ == "__main__":
     i = Plugin()
Index: sansview/perspectives/fitting/modelpage.py
===================================================================
--- sansview/perspectives/fitting/modelpage.py	(revision 0056173917543f1d2329e6d57462f61b0b92d261)
+++ sansview/perspectives/fitting/modelpage.py	(revision 2dbb6812a796357379c72f2ee764a292e372784d)
@@ -39,5 +39,5 @@
     
     
-    def __init__(self, parent,model,description, *args, **kwargs):
+    def __init__(self, parent,model, *args, **kwargs):
         wx.Panel.__init__(self, parent, *args, **kwargs)
         """ 
@@ -80,6 +80,9 @@
         # model on which the fit would be performed
         self.model=model
-        self.description=description
-        self.set_panel(model,description)
+        try:
+            print"init modelpage",model.name
+            self.set_panel(model)
+        except:
+            raise
         # preview selected model name
         self.prevmodel_name=model.__class__.__name__
@@ -95,5 +98,5 @@
         self.SetSizer(self.vbox)
         self.Centre()
-        
+       
         
     def onClose(self,event):
@@ -123,27 +126,30 @@
         id=0
         self.model_list_box=dict
-        for item in self.model_list_box.itervalues():
-            if hasattr(item, "name"):
-                name = item.name
-            else:
-                name = item.__name__
-            
+        list_name=[]
+        for item in  self.model_list_box.itervalues():
+            name = item.__name__
+            model=item()
+            if hasattr(model, "name"):
+                name = model.name
+            list_name.append(name)
+        list_name.sort()   
+        for name in list_name:
             self.modelbox.Insert(name,int(id))
             id+=1
-            
-            wx.EVT_COMBOBOX(self.modelbox,-1, self._on_select_model) 
+        wx.EVT_COMBOBOX(self.modelbox,-1, self._on_select_model) 
         return 0
    
-    def set_page(self, model,description):
+    def set_page(self, model,description=None):
         #print " modelpage: set_page was called",model
         self.model=model
-        self.description=description
+        name = self.model.__class__.__name__
         if hasattr(self.model, "name"):
             name = self.model.name
-        else:
-            name = self.model.__class__.__name__
+        
+           
         self.modelbox.SetValue(name)
-        self.set_panel(self.model,description)
+        self.set_panel(self.model)
         self.manager.draw_model(self.model)
+        
     def _on_select_model(self,event):
         """
@@ -153,17 +159,14 @@
         #print "modelpage: self.model_list_box ",self.model_list_box
         for item in self.model_list_box.itervalues():
-            model=item()
-            #print "modelpage:model",model
-            if hasattr(model, "name"):
-                name = model.name
-            else:
-                name = model.__class__.__name__
-            try:
-                if name ==event.GetString():
-                    self.model=model
-                    self.set_panel(self.model)
-                    self.manager.draw_model(self.model)
-            except:
-                raise #ValueError,"model.name is not equal to model class name"
+            name = item.__name__
+            items=item()
+            if hasattr(items, "name"):
+                name = items.name
+            print "fitpage: _on_select_model model name",name ,event.GetString()
+            if name ==event.GetString():
+                model=items
+                print "fitpage: _on_select_model model name",name ,event.GetString()
+                self.manager.draw_model(model)
+                self.set_panel(model)
     def set_model_name(self,name):
         """ 
@@ -197,10 +200,10 @@
         
         
-    def set_panel(self,model,description=None):
+    def set_panel(self,model):
         """
             Build the panel from the model content
             @param model: the model selected in combo box for fitting purpose
         """
-    
+        
         self.sizer2.Clear(True)
         self.sizer1.Clear(True)
@@ -210,4 +213,5 @@
         keys = self.model.getParamList()
         keys.sort()
+        print "went here",self.model.name,model.description
         iy = 1
         ix = 0
@@ -216,5 +220,5 @@
                           wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         ix += 1
-        self.cb01 = wx.StaticText(self, -1,str(description))
+        self.cb01 = wx.StaticText(self, -1,str(model.description))
         self.sizer1.Add(self.cb01,(iy, ix),(1,1),\
                           wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
@@ -245,5 +249,4 @@
             ctl1.Bind(wx.EVT_TEXT_ENTER, self._onparamEnter)
             self.sizer2.Add(ctl1, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-           
             ix +=1
             # Units
@@ -262,8 +265,7 @@
             else:
                 self.text2_4.Hide()
-       
         self.vbox.Layout()
         self.GrandParent.GetSizer().Layout()
-        
+        print "out"
         
     def _onparamEnter(self,event):
@@ -280,9 +282,7 @@
                      value= float(item[1].GetValue())
                      self.model.setParam(name,value)
-                     self.manager.draw_model(self.model)
                 except:
-                    
                      wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\
                             "Model Drawing  Error:wrong value entered : %s"% sys.exc_value))
-   
-  
+            self.manager.draw_model(self.model)
+  
Index: sansview/perspectives/fitting/models.py
===================================================================
--- sansview/perspectives/fitting/models.py	(revision 0056173917543f1d2329e6d57462f61b0b92d261)
+++ sansview/perspectives/fitting/models.py	(revision 2dbb6812a796357379c72f2ee764a292e372784d)
@@ -6,17 +6,5 @@
 (ModelEvent, EVT_MODEL) = wx.lib.newevent.NewEvent()
 
-class ModelInfo(object):
-    """
-         this class contains description for a given model
-    """
-    def __init__(self,model,description=None):
-        self.model=model
-        self.description=description
-        
-    def set_description(self, descrition):
-        self.description =str(description)
-        
-    def get_description(self):
-        return self.description
+
     
     
@@ -84,27 +72,26 @@
         self.model_list = {}
         self.model_list_box = {}
-        
-        model_info="shape-based models"
+       
         
         from sans.models.SphereModel import SphereModel
-        self.model_list[str(wx.NewId())] =  ModelInfo(SphereModel , model_info)
+        self.model_list[str(wx.NewId())] =  SphereModel
         
         from sans.models.CylinderModel import CylinderModel
-        self.model_list[str(wx.NewId())] = ModelInfo(CylinderModel , model_info)
+        self.model_list[str(wx.NewId())] =CylinderModel
       
         from sans.models.CoreShellModel import CoreShellModel
-        self.model_list[str(wx.NewId())] = ModelInfo(CoreShellModel , model_info)
+        self.model_list[str(wx.NewId())] = CoreShellModel 
         
         from sans.models.CoreShellCylinderModel import CoreShellCylinderModel
-        self.model_list[str(wx.NewId())] = ModelInfo(CoreShellCylinderModel , model_info)
+        self.model_list[str(wx.NewId())] =CoreShellCylinderModel
         
         from sans.models.EllipticalCylinderModel import EllipticalCylinderModel
-        self.model_list[str(wx.NewId())] = ModelInfo(EllipticalCylinderModel , model_info)
+        self.model_list[str(wx.NewId())] =EllipticalCylinderModel
         
         from sans.models.EllipsoidModel import EllipsoidModel
-        self.model_list[str(wx.NewId())] = ModelInfo(EllipsoidModel , model_info)
+        self.model_list[str(wx.NewId())] = EllipsoidModel 
         
         from sans.guitools.LineModel import LineModel
-        self.model_list[str(wx.NewId())]  = ModelInfo(LineModel , model_info)
+        self.model_list[str(wx.NewId())]  = LineModel
         
         
@@ -112,13 +99,11 @@
         
         from sans.models.BEPolyelectrolyte import BEPolyelectrolyte
-        self.indep_model.append( ModelInfo( BEPolyelectrolyte , model_info) )
+        self.indep_model.append(BEPolyelectrolyte )
         
         from sans.models.DABModel import DABModel
-        self.indep_model.append( ModelInfo(DABModel , model_info+
-        "\n Evaluates F(x) = scale/( 1 + (x*L)^2 )^(2) +bkd") )
+        self.indep_model.append(DABModel )
         
         from sans.models.DebyeModel import DebyeModel
-        self.indep_model.append( ModelInfo(DebyeModel , model_info+
-        "\n Evaluates F(x) = 2( exp(-x)+x -1 )/x**2") )
+        self.indep_model.append(DebyeModel )
         
         from sans.models.FractalModel import FractalModel
@@ -126,9 +111,8 @@
             def _Fractal(self, x):
                 return FractalModel._Fractal(self, math.fabs(x))
-        self.indep_model.append( ModelInfo(FractalAbsModel , model_info) )
+        self.indep_model.append(FractalAbsModel)
         
         from sans.models.LorentzModel import LorentzModel
-        self.indep_model.append( ModelInfo(LorentzModel , model_info+
-                "\n Evaluates F(x)= scale/( 1 + (x*L)^2 ) + bkd ") ) 
+        self.indep_model.append( LorentzModel) 
             
         from sans.models.PowerLawModel import PowerLawModel
@@ -139,17 +123,8 @@
                 except:
                     print sys.exc_value  
-        self.indep_model.append( ModelInfo(PowerLawAbsModel , model_info+
-        "\n Evaluates abs(F(x)) \n with F(x) = scale* (x)^(m) + bkd ") )
-                    
-       
+        self.indep_model.append( PowerLawAbsModel )
         from sans.models.TeubnerStreyModel import TeubnerStreyModel
-        self.indep_model.append( ModelInfo(TeubnerStreyModel , model_info) )
-        
-        
-          
-        
-        
-      
-        
+        self.indep_model.append(TeubnerStreyModel )
+    
         #Looking for plugins
         self.plugins = findModels()
@@ -169,48 +144,43 @@
         self._getModelList()
         self.event_owner = event_owner
-        
         shape_submenu= wx.Menu() 
         indep_submenu = wx.Menu()
         added_models = wx.Menu()
-        
         for id_str,value in self.model_list.iteritems():
-            item = self.model_list[id_str]
-            name = item.model.__name__
+            item = self.model_list[id_str]()
+            name = item.__class__.__name__
             if hasattr(item, "name"):
-                name = item.model.name
-            self.model_list_box[name] =value.model
+                name = item.name
+            self.model_list_box[name] =value
             shape_submenu.Append(int(id_str), name, name)
             wx.EVT_MENU(event_owner, int(id_str), self._on_model)
         modelmenu.AppendMenu(wx.NewId(), "Shapes...", shape_submenu, "List of shape-based models")
-        
         id = wx.NewId()
         if len(self.indep_model_list) == 0:
-            for item in self.indep_model:
+            for items in self.indep_model:
                 #if item not in self.indep_model_list.values():
                     #self.indep_model_list[str(id)] = item
-                self.model_list[str(id)]=item
-                name = item.model.__name__
+                self.model_list[str(id)]=items
+                item=items()
+                name = item.__class__.__name__
                 if hasattr(item, "name"):
-                    name = item.model.name
+                    name = item.name
                 indep_submenu.Append(id,name, name)
-                self.model_list_box[name] =item.model
+                self.model_list_box[name] =items
                 wx.EVT_MENU(event_owner, int(id), self._on_model)
                 id = wx.NewId()         
         modelmenu.AppendMenu(wx.NewId(), "Shape-independent...", indep_submenu, "List of shape-independent models")
-        
-        
-        
-        model_info="additional models"
         id = wx.NewId()
         if len(self.custom_models) == 0:
-            for item in self.plugins:
+            for items in self.plugins:
                 #if item not in self.custom_models.values():
                     #self.custom_models[str(id)] = item
-                self.model_list[str(id)]=ModelInfo(item,model_info)
-                name = item.__name__
+                self.model_list[str(id)]=items
+                item=items()
+                name = item.__class__.__name__
                 if hasattr(item, "name"):
                     name = item.name
                 added_models.Append(id, name, name)
-                self.model_list_box[name] =item
+                self.model_list_box[name] =items
                 wx.EVT_MENU(event_owner, int(id), self._on_model)
                 id = wx.NewId()
@@ -231,5 +201,5 @@
            
             model = self.model_list[str(evt.GetId())]
-            evt = ModelEvent(modelinfo=model)
+            evt = ModelEvent(model= model )
             wx.PostEvent(self.event_owner, evt)
         
