Ignore:
Timestamp:
Aug 10, 2010 3:09:40 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
3eb2811
Parents:
ac2dc0e
Message:

added ability to reset the panels when a new svs file is opened

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/fitpanel.py

    rac2dc0e r8897d66  
    205205    def close_all(self): 
    206206        """ 
    207         remove all pages 
    208         """ 
    209         for index in range(self.GetPageCount()): 
    210             self.DeletePage(index) 
    211         self.model_list_box = {} 
     207        remove all pages, used when a svs file is opened 
     208        """ 
     209        #get number of pages 
     210        nop = self.GetPageCount() 
     211        #use while-loop, for-loop will not do the job well. 
     212        while (nop>0): 
     213            #delete the first page until no page exists 
     214            page = self.GetPage(0) 
     215            self._close_helper(selected_page=page) 
     216            self.DeletePage(0) 
     217            nop = nop - 1 
    212218        ## save the title of the last page tab added 
    213219        self.fit_page_name = {} 
Note: See TracChangeset for help on using the changeset viewer.