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

fix for wx2.8 and null file path

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.