Changeset 4154 for trunk/GSASII.py


Ignore:
Timestamp:
Sep 18, 2019 5:05:24 PM (2 years ago)
Author:
toby
Message:

allow open of multiple GPX files on Mac

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r4148 r4154  
    2424'''
    2525
     26import sys
     27import os
    2628import platform
    2729import wx
     
    3133__version__ = '1.0.0'
    3234
     35class G2App(wx.App):
     36    '''Used to create a wx python application for the GUI for Mac.
     37    Customized to implement drop of GPX files onto app.
     38    '''
     39    startupMode = True
     40    def ClearStartup(self):
     41        '''Call this after app startup complete because a Drop event is posted
     42        when GSAS-II is initially started.
     43        '''
     44        self.startupMode = False       
     45    def MacOpenFiles(self, filenames):
     46        if self.startupMode:
     47            return
     48        for project in filenames:
     49            #print("Start GSAS-II with project file "+str(project))
     50            GSASIIpath.MacStartGSASII(__file__,project)
     51
    3352if __name__ == '__main__':
    34     application = wx.App(0) # create the GUI framework
     53    if sys.platform == "darwin":
     54        application = G2App(0) # create the GUI framework
     55    else:
     56        application = wx.App(0) # create the GUI framework
    3557    try:
    3658        GSASIIpath.SetBinaryPath(True)
     
    5375    import GSASIIdataGUI as G2gd   
    5476    G2gd.GSASIImain(application) # start the GUI
     77    if sys.platform == "darwin":
     78        wx.CallLater(100,application.ClearStartup)
    5579    application.MainLoop()
Note: See TracChangeset for help on using the changeset viewer.