Changeset 2975


Ignore:
Timestamp:
Aug 8, 2017 4:54:15 PM (4 years ago)
Author:
toby
Message:

fix for wx2.8 and null file path

Location:
branch/2frame
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branch/2frame/GSASIIdataGUI.py

    r2963 r2975  
    45584558        Sizer = self.GetSizer()
    45594559        if not Sizer: return
    4560         if Sizer.GetItemCount() == 1: # if there is a single grid, resize it
     4560        #if Sizer.GetItemCount() == 1: # not wx 2.8
     4561        if len(Sizer.GetChildren()) == 1: # if there is a single grid, resize it
    45614562            if isinstance(Sizer.GetItem(0).GetWindow(), G2G.GSGrid):
    45624563                Sizer.GetItem(0).GetWindow().SetSize(self.GetSize())
     
    45704571            if GSASIIpath.GetConfigValue('debug'): raise Exception
    45714572            return
    4572         if Sizer.GetItemCount() == 1: # handle cases with a single grid in DataWindow differently
     4573        #if Sizer.GetItemCount() == 1: # not wx 2.8
     4574        if len(Sizer.GetChildren()) == 1: # handle cases with a single grid in DataWindow differently
    45734575            # note that Grid's scroll bars must be turned on with .SetScrollRate(1,1)
    45744576            # just after the call to .GSGrid()
  • branch/2frame/GSASIIplot.py

    r2967 r2975  
    382382        '''Adds additional icons to toolbar'''
    383383        Toolbar.__init__(self,plotCanvas)
     384        G2path = os.path.split(os.path.abspath(__file__))[0]
    384385        self.plotCanvas = plotCanvas
    385386        POSITION_OF_CONFIGURE_SUBPLOTS_BTN = 6 # remove one button, nos. start at 1!
    386387        self.DeleteToolByPos(POSITION_OF_CONFIGURE_SUBPLOTS_BTN)    #doesn't work in miniconda
    387388        self.parent = self.GetParent()
    388         key = os.path.join(os.path.split(__file__)[0],'key.ico')
     389        key = os.path.join(G2path,'key.ico')
    389390        self.AddSimpleTool(self.ON_MPL_KEY,_load_bitmap(key),'Key press','Select key press')
    390391        wx.EVT_TOOL(self,self.ON_MPL_KEY,self.OnKey)
    391         help = os.path.join(os.path.split(__file__)[0],'help.ico')
     392        help = os.path.join(G2path,'help.ico')
    392393        self.AddSimpleTool(self.ON_MPL_HELP,_load_bitmap(help),'Help on','Show help on')
    393394        wx.EVT_TOOL(self,self.ON_MPL_HELP,self.OnHelp)
     
    395396        for direc in ('left','right','up','down'):
    396397            wx.EVT_TOOL(self,self.arrows[direc],self.OnArrow)
    397             icon =  os.path.join(os.path.split(__file__)[0],direc[0]+'arrow.ico')
     398            icon =  os.path.join(G2path,direc[0]+'arrow.ico')
    398399            self.AddSimpleTool(self.arrows[direc],_load_bitmap(icon),
    399400                               'Shift '+direc,'Shift plot '+direc)
     
    401402            fil = ''.join([i[0].lower() for i in direc.split()]+['arrow.ico'])
    402403            wx.EVT_TOOL(self,self.arrows[direc],self.OnArrow)
    403             icon =  os.path.join(os.path.split(__file__)[0],fil)
     404            icon =  os.path.join(G2path,fil)
    404405            self.AddSimpleTool(self.arrows[direc],_load_bitmap(icon),
    405406                               direc,'Zoom: '+direc)
Note: See TracChangeset for help on using the changeset viewer.