Changeset 2531 for trunk/GSASIIctrls.py


Ignore:
Timestamp:
Nov 17, 2016 11:43:57 AM (5 years ago)
Author:
toby
Message:

reopen tree items after a refinement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrls.py

    r2527 r2531  
    220220        else:
    221221            return size,imagefile,None
     222
     223    def SaveExposedItems(self):
     224        '''Traverse the top level tree items and save names of exposed (expanded) tree items.
     225        Done before a refinement.
     226        '''
     227        self.ExposedItems = []
     228        item, cookie = self.GetFirstChild(self.root)
     229        while item:
     230            name = self.GetItemText(item)
     231            if self.IsExpanded(item): self.ExposedItems.append(name)
     232            item, cookie = self.GetNextChild(self.root, cookie)
     233        print 'exposed:',self.ExposedItems
     234
     235    def RestoreExposedItems(self):
     236        '''Traverse the top level tree items and restore exposed (expanded) tree items
     237        back to their previous state (done after a reload of the tree after a refinement)
     238        '''
     239        item, cookie = self.GetFirstChild(self.root)
     240        while item:
     241            name = self.GetItemText(item)
     242            if name in self.ExposedItems: self.Expand(item)
     243            item, cookie = self.GetNextChild(self.root, cookie)
    222244
    223245################################################################################
Note: See TracChangeset for help on using the changeset viewer.