panda3d/direct/src/showbase/TkGlobal.py
2003-07-03 20:04:42 +00:00

28 lines
735 B
Python

from Tkinter import *
import Pmw
import sys
# This is required by the ihooks.py module used by Squeeze (used by
# pandaSqueezer.py) so that Pmw initializes properly
sys.modules['_Pmw'].__name__ = '_Pmw'
__builtins__["tkroot"] = Pmw.initialise()
def tkloop(self):
# 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 tkinter.dooneevent(tkinter.ALL_EVENTS | tkinter.DONT_WAIT):
pass
# Run forever
return Task.cont
# Get the taskMgr
from TaskManagerGlobal import *
def spawnTkLoop():
# Spawn this task
taskMgr.add(tkloop, "tkloop")