X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/02b800ce7c2bb1c1f08075f22be2e7412124b47f..e81b607b4322af54190484aa7ee34112337a344e:/wxPython/demo/MDIWindows.py diff --git a/wxPython/demo/MDIWindows.py b/wxPython/demo/MDIWindows.py index 521c14cc66..4fa3ad01df 100644 --- a/wxPython/demo/MDIWindows.py +++ b/wxPython/demo/MDIWindows.py @@ -28,12 +28,29 @@ class TestPanel(wx.Panel): # some problems related to having regular frames and MDI frames in # the same app. def ShowMDIDemo(self, evt): - os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, "MDIDemo.py") + exe, spawn = self.GetPyExecutable() + spawn(os.P_NOWAIT, exe, exe, "MDIDemo.py") def ShowMDISashDemo(self, evt): - os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, "MDISashDemo.py") - - + exe, spawn = self.GetPyExecutable() + spawn(os.P_NOWAIT, exe, exe, "MDISashDemo.py") + + # TODO: This hack can be removed once we fix the way the Python + # app bundles are generated so that they are not bundling and + # pointing to an otherwise unused and non-GUI-friendly version of + # Python on OS X. + def GetPyExecutable(self): + if 'wxMac' in wx.PlatformInfo: + # sys.executable will be wrong if running the demo from + # an app bundle. But the bundle is always using a system + # framework so just hardcode the path to it. + if sys.version[:3] == "2.4": + return '/usr/local/bin/pythonw', os.spawnl + else: + return '/usr/bin/pythonw', os.spawnl + else: + return sys.executable, os.spawnl + #---------------------------------------------------------------------- def runTest(frame, nb, log):