File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -191,14 +191,31 @@ class CefApp(wx.App):
191191 def __init__ (self , redirect ):
192192 self .timer = None
193193 self .timer_id = 1
194+ self .is_initialized = False
194195 super (CefApp , self ).__init__ (redirect = redirect )
195196
197+ def OnPreInit (self ):
198+ super (CefApp , self ).OnPreInit ()
199+ # On Mac with wxPython 4.0 the OnInit() event never gets
200+ # called. Doing wx window creation in OnPreInit() seems to
201+ # resolve the problem (Issue #350).
202+ if MAC and wx .version ().startswith ("4." ):
203+ print ("[wxpython.py] OnPreInit: initialize here"
204+ " (wxPython 4.0 fix)" )
205+ self .initialize ()
206+
196207 def OnInit (self ):
208+ self .initialize ()
209+ return True
210+
211+ def initialize (self ):
212+ if self .is_initialized :
213+ return
197214 self .create_timer ()
198215 frame = MainFrame ()
199216 self .SetTopWindow (frame )
200217 frame .Show ()
201- return True
218+ self . initialized = True
202219
203220 def create_timer (self ):
204221 # See also "Making a render loop":
Original file line number Diff line number Diff line change 11# This file was generated by setup.py
2- DEF UNAME_SYSNAME = " Windows "
2+ DEF UNAME_SYSNAME = " Darwin "
33DEF PY_MAJOR_VERSION = 3
Original file line number Diff line number Diff line change @@ -242,6 +242,8 @@ def get_python_include_path():
242242 try_dirs = ["{base_dir}/include" ,
243243 "{base_dir}/../include/python{ver}" ,
244244 "{base_dir}/../include/python{ver}*" ,
245+ ("{base_dir}/../Frameworks/Python.framework/Versions/{ver}"
246+ "/include/python{ver}*" ),
245247 "/usr/include/python{ver}" ]
246248 ver_tuple = sys .version_info [:2 ]
247249 ver = "{major}.{minor}" .format (major = ver_tuple [0 ], minor = ver_tuple [1 ])
You can’t perform that action at this time.
0 commit comments