Remove the hack for wx.CallAfter. A fix for wx.GetApp when embedding is on the way

This commit is contained in:
Robin Dunn
2019-09-12 14:56:18 -07:00
parent 28882cbb5d
commit a2e12af3d8

View File

@@ -1,5 +1,4 @@
import wx
wx.CallAfter = lambda x, y : (x, y)
from wx.py import shell, version
class MyPanel(wx.Panel):
@@ -7,17 +6,15 @@ class MyPanel(wx.Panel):
def __init__(self, parent):
# super makes the same as wx.Panel.__init__(self, parent, etc..)
# but prepares for Python 3.0 among other things...
super(MyPanel, self).__init__(parent, -1,
super(MyPanel, self).__init__(parent, -1,
style = wx.BORDER_NONE | wx.MAXIMIZE)
text = wx.StaticText(self, -1,
"Everything on this side of the splitter comes from Python.")
intro = 'Welcome To PyCrust %s - The Flakiest Python Shell' % version.VERSION
# the Pycrust shell object
# Ugly hack to overwrite wx.CallAfter, as it requires wx.GetApp()
# to return != None
pycrust = shell.Shell(self,-1, introText = intro)
# pycrust = wx.TextCtrl(self, -1, intro)