parameters: (self)
docstring: Call this method to hand the main loop over to Tkinter.
          This sets up a timer callback so that Panda still gets
          updated, but Tkinter owns the main loop (which seems to make
          it happier than the other way around).
docstring_summary: Call this method to hand the main loop over to Tkinter.
          This sets up a timer callback so that Panda still gets
          updated, but Tkinter owns the main loop (which seems to make
          it happier than the other way around).
docstring_tokens: Call this method to hand the main loop over to Tkinter . This sets up a timer callback so that Panda still gets updated but Tkinter owns the main loop ( which seems to make it happier than the other way around ) .
function: def spawnTkLoop(self):
          """ Call this method to hand the main loop over to Tkinter.
          This sets up a timer callback so that Panda still gets
          updated, but Tkinter owns the main loop (which seems to make
          it happier than the other way around). """
  
          if self.tkRootCreated:
              # Don't do this twice.
              return
  
          # Use importlib to prevent this import from being picked up
          # by modulefinder when packaging an application.
          tkinter = importlib.import_module('_tkinter')
          Pmw = importlib.import_module('Pmw')
  
          # Create a new Tk root.
          if not self.tkRoot:
              self.tkRoot = Pmw.initialise()
          builtins.tkroot = self.tkRoot
  
          init_app_for_gui()
  
          # Disable the Windows message loop, since Tcl wants to handle this all
          # on its own.
          ConfigVariableBool('disable-message-loop', False).value = True
  
          if ConfigVariableBool('tk-main-loop', True):
              # Put Tkinter in charge of the main loop.  It really
              # seems to like this better; the GUI otherwise becomes
              # largely unresponsive on Mac OS X unless this is true.
  
              # Set a timer to run the Panda frame 60 times per second.
              tkFrameRate = ConfigVariableDouble('tk-frame-rate', 60.0)
              self.tkDelay = int(1000.0 / tkFrameRate.value)
              self.tkRoot.after(self.tkDelay, self.__tkTimerCallback)
  
              # wx is now the main loop, not us any more.
              self.run = self.tkRun
              self.taskMgr.run = self.tkRun
              builtins.run = self.tkRun
              if self.appRunner:
                  self.appRunner.run = self.tkRun
  
          else:
              # Leave Panda in charge of the main loop.  This is
              # friendlier for IDE's and interactive editing in general.
              def tkLoop(task):
                  # Do all the tkinter events waiting on this frame
                  # dooneevent will return 0 if there are no more events
                  # waiting or 1 if there are still more.
                  # DONT_WAIT tells tkinter not to block waiting for events
                  while self.tkRoot.dooneevent(tkinter.ALL_EVENTS | tkinter.DONT_WAIT):
                      pass
  
                  return task.again
  
              self.taskMgr.add(tkLoop, 'tkLoop')
          self.tkRootCreated = True
function_tokens: def spawnTkLoop ( self ) : if self . tkRootCreated : # Don't do this twice. return # Use importlib to prevent this import from being picked up # by modulefinder when packaging an application. tkinter = importlib . import_module ( '_tkinter' ) Pmw = importlib . import_module ( 'Pmw' ) # Create a new Tk root. if not self . tkRoot : self . tkRoot = Pmw . initialise ( ) builtins . tkroot = self . tkRoot init_app_for_gui ( ) # Disable the Windows message loop, since Tcl wants to handle this all # on its own. ConfigVariableBool ( 'disable-message-loop' , False ) . value = True if ConfigVariableBool ( 'tk-main-loop' , True ) : # Put Tkinter in charge of the main loop.  It really # seems to like this better; the GUI otherwise becomes # largely unresponsive on Mac OS X unless this is true. # Set a timer to run the Panda frame 60 times per second. tkFrameRate = ConfigVariableDouble ( 'tk-frame-rate' , 60.0 ) self . tkDelay = int ( 1000.0 / tkFrameRate . value ) self . tkRoot . after ( self . tkDelay , self . __tkTimerCallback ) # wx is now the main loop, not us any more. self . run = self . tkRun self . taskMgr . run = self . tkRun builtins . run = self . tkRun if self . appRunner : self . appRunner . run = self . tkRun else : # Leave Panda in charge of the main loop.  This is # friendlier for IDE's and interactive editing in general. def tkLoop ( task ) : # Do all the tkinter events waiting on this frame # dooneevent will return 0 if there are no more events # waiting or 1 if there are still more. # DONT_WAIT tells tkinter not to block waiting for events while self . tkRoot . dooneevent ( tkinter . ALL_EVENTS | tkinter . DONT_WAIT ) : pass return task . again self . taskMgr . add ( tkLoop , 'tkLoop' ) self . tkRootCreated = True