Browse Source

allow want-direct to work with window-type none

David Rose 19 years ago
parent
commit
86d6eeefaf
1 changed files with 8 additions and 7 deletions
  1. 8 7
      direct/src/showbase/ShowBase.py

+ 8 - 7
direct/src/showbase/ShowBase.py

@@ -307,13 +307,6 @@ class ShowBase(DirectObject.DirectObject):
         # This needs to be allocated even if the viewer is off.
         self.bufferViewer = BufferViewer()
 
-        # Start Tk and DIRECT if specified by Config.prc
-        fTk = self.config.GetBool('want-tk', 0)
-        # Start DIRECT if specified in Config.prc or in cluster mode
-        fDirect = (self.config.GetBool('want-directtools', 0) or
-                   (base.config.GetString("cluster-mode", '') != ''))
-        # Set fWantTk to 0 to avoid starting Tk with this call
-        self.startDirect(fWantDirect = fDirect, fWantTk = fTk)
         # Start IGLOOP
         self.restart()
 
@@ -582,6 +575,14 @@ class ShowBase(DirectObject.DirectObject):
                 # error not to open a window.
                 raise StandardError, 'Could not open window.'
 
+        # Start Tk and DIRECT if specified by Config.prc
+        fTk = self.config.GetBool('want-tk', 0)
+        # Start DIRECT if specified in Config.prc or in cluster mode
+        fDirect = (self.config.GetBool('want-directtools', 0) or
+                   (base.config.GetString("cluster-mode", '') != ''))
+        # Set fWantTk to 0 to avoid starting Tk with this call
+        self.startDirect(fWantDirect = fDirect, fWantTk = fTk)
+
         return self.win != None
 
     def isMainWindowOpen(self):