Browse Source

fix Tk crash on OSX

rdb 14 years ago
parent
commit
9dcc7a5e35
1 changed files with 3 additions and 1 deletions
  1. 3 1
      direct/src/showbase/ShowBase.py

+ 3 - 1
direct/src/showbase/ShowBase.py

@@ -2802,8 +2802,10 @@ class ShowBase(DirectObject.DirectObject):
         fWantTk = bool(fWantTk)
         if self.wantTk != fWantTk:
             self.wantTk = fWantTk
-            initAppForGui()
+            # We need to import this before initAppForGui,
+            # in order to prevent a low-level crash on OSX
             from direct.showbase import TkGlobal
+            initAppForGui()
             TkGlobal.spawnTkLoop()
 
     def startDirect(self, fWantDirect = 1, fWantTk = 1, fWantWx = 0):