Index: sansview/bugs.txt
===================================================================
--- sansview/bugs.txt	(revision d171299e22382ed2d80b560a39d007eb64c9d805)
+++ sansview/bugs.txt	(revision 0550752dc180ea7274e02461da6de9919c35387d)
@@ -11,2 +11,7 @@
 5- plot data2D theory not working for all models
 ---->bugs[5] fixed
+---------------------------------------------------------------------------------
+1. close button does not show up properly when selecting model.
+static text is showing when  randomly when slecting the model to fit for the first time
+
+2.
Index: sansview/perspectives/fitting/fitpage1D.py
===================================================================
--- sansview/perspectives/fitting/fitpage1D.py	(revision 04edd0d845537a4d4c411d1d7fb4fe7c3acffcbb)
+++ sansview/perspectives/fitting/fitpage1D.py	(revision 0550752dc180ea7274e02461da6de9919c35387d)
@@ -65,7 +65,9 @@
        
         self.vbox.Add(self.sizer3)
+        
         self.vbox.Add(self.sizer2)
         self.vbox.Add(self.static_line_1, 0, wx.EXPAND, 0)
         self.vbox.Add(self.sizer5)
+        
         self.vbox.Add(self.sizer4)
         self.vbox.Add(self.sizer1)
@@ -89,22 +91,20 @@
         ix += 1
         self.sizer3.Add(self.modelbox,(iy,ix),(1,1),  wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        
         ix = 0
         iy = 1
         #set maximum range for x in linear scale
-        self.text4_3 = wx.StaticText(self, -1, 'Maximum Data\n Range (Linear)', style=wx.ALIGN_LEFT)
+        self.text4_3 = wx.StaticText(self, -1, 'Maximum Data Range(Linear)', style=wx.ALIGN_LEFT)
         self.sizer4.Add(self.text4_3,(iy,ix),(1,1),\
                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         ix += 1
-        self.text4_1 = wx.StaticText(self, -1, 'Min')
-        self.sizer4.Add(self.text4_1,(iy, ix),(1,1),\
+        self.sizer4.Add(wx.StaticText(self, -1, 'Min'),(iy, ix),(1,1),\
                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         ix += 2
-        self.text4_2 = wx.StaticText(self, -1, 'Max')
-        self.sizer4.Add(self.text4_2,(iy, ix),(1,1),\
+        self.sizer4.Add(wx.StaticText(self, -1, 'Max'),(iy, ix),(1,1),\
                             wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         ix = 0
         iy += 1
-        self.text4_4 = wx.StaticText(self, -1, 'x range')
-        self.sizer4.Add(self.text4_4,(iy, ix),(1,1),\
+        self.sizer4.Add(wx.StaticText(self, -1, 'x range'),(iy, ix),(1,1),\
                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         ix += 1
@@ -112,22 +112,28 @@
         self.xmin.SetValue(format_number(numpy.min(data.x)))
         self.xmin.SetToolTipString("Minimun value of x in linear scale.")
-        self.sizer4.Add(self.xmin,(iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         self.xmin.Bind(wx.EVT_KILL_FOCUS, self._onTextEnter)
         self.xmin.Bind(wx.EVT_TEXT_ENTER, self._onTextEnter)
         self.xmin.Disable()
+        self.sizer4.Add(self.xmin,(iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        
+       
         ix += 2
         self.xmax    = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20))
         self.xmax.SetValue(format_number(numpy.max(data.x)))
         self.xmax.SetToolTipString("Maximum value of x in linear scale.")
-        self.sizer4.Add(self.xmax,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         self.xmax.Bind(wx.EVT_KILL_FOCUS, self._onTextEnter)
         self.xmax.Bind(wx.EVT_TEXT_ENTER, self._onTextEnter)
         self.xmax.Disable()
+        self.sizer4.Add(self.xmax,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        ix =0
         iy+=1
-        self.sizer4.Add((20,20),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        self.sizer4.Add((20,20),(iy,ix),(1,1),wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         #Set chisqr  result into TextCtrl
         ix = 0
         iy = 1
-        
+        self.smear= wx.CheckBox(self, -1, "Smear", (10, 10))
+        self.sizer1.Add(self.smear,(iy,ix),(1,1),\
+                   wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        iy+=1
         self.text1_1 = wx.StaticText(self, -1, 'Chi2/dof', style=wx.ALIGN_LEFT)
         #self.sizer1.Add(self.text1_1,1)
@@ -142,9 +148,9 @@
         #self.sizer1.Add(self.btFit, 1, wx.LEFT | wx.BOTTOM , 5)
         self.sizer1.Add(self.btFit,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        ix+= 1
+        ix+= 2
         self.sizer1.Add( self.btClose,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         #self.sizer1.Add( self.btClose,1, wx.LEFT | wx.BOTTOM , 5)
 
-        ix= 1
+        ix= 0
         iy+=1
         self.sizer1.Add((20,20),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)
@@ -464,4 +470,5 @@
         self.set_model_parameter()
         self.compute_chisqr()
+        
      
     def set_model_parameter(self):
@@ -473,5 +480,7 @@
             for item in self.parameters:
                 try:
-                    
+                    item[2].Hide()
+                    item[3].Clear()
+                    item[3].Hide()
                     name=str(item[0].GetLabelText())
                     value= float(item[1].GetValue())
Index: sansview/perspectives/fitting/fitting.py
===================================================================
--- sansview/perspectives/fitting/fitting.py	(revision 57668f8d8031518b8e4c968a15699310b27c3d36)
+++ sansview/perspectives/fitting/fitting.py	(revision 0550752dc180ea7274e02461da6de9919c35387d)
@@ -1,5 +1,5 @@
 import os,os.path, re
 import sys, wx, logging
-import string, numpy,  math
+import string, numpy, math
 
 from copy import deepcopy 
@@ -578,12 +578,11 @@
              draw model with default data value
         """
-        x = pylab.arange(0.001, 0.1, 0.001)
+        x = numpy.arange(0.001, 0.1, 0.001)
         xlen = len(x)
-        dy = numpy.zeros(xlen)
         y = numpy.zeros(xlen)
         
         for i in range(xlen):
             y[i] = model.run(x[i])
-            dy[i] = math.sqrt(math.fabs(y[i]))
+
         try:
             new_plot = Theory1D(x, y)
@@ -591,4 +590,5 @@
             new_plot.xaxis("\\rm{Q}", 'A^{-1}')
             new_plot.yaxis("\\rm{Intensity} ","cm^{-1}")
+             
             new_plot.group_id ="Fitness"
             wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Analytical model"))
