open_toontown_panda3d/direct/src/showbase/WxGlobal.py

18 lines
437 B
Python
Executable File

import wx
from direct.task.Task import Task
def wxLoop(self):
# Do all the wxPython events waiting on this frame
while base.wxApp.Pending():
base.wxApp.Dispatch()
return Task.cont
def spawnWxLoop():
if not getattr(base, 'wxApp', None):
# Create a new base.wxApp, but only if it's not already
# created.
base.wxApp = wx.App(False)
# Spawn this task
taskMgr.add(wxLoop, "wxLoop")