+21
-2
lines changedFilter options
+21
-2
lines changed Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
2
2
# This example has a top menu and a browser widget without navigation bar.
3
3
4
4
# Tested configurations:
5
-
# - wxPython 4.0 on Windows/Linux
5
+
# - wxPython 4.0 on Windows/Mac/Linux
6
6
# - wxPython 3.0 on Windows/Mac
7
7
# - wxPython 2.8 on Linux
8
8
# - CEF Python v55.4+
@@ -189,14 +189,31 @@ class CefApp(wx.App):
189
189
def __init__(self, redirect):
190
190
self.timer = None
191
191
self.timer_id = 1
192
+
self.is_initialized = False
192
193
super(CefApp, self).__init__(redirect=redirect)
193
194
195
+
def OnPreInit(self):
196
+
super(CefApp, self).OnPreInit()
197
+
# On Mac with wxPython 4.0 the OnInit() event never gets
198
+
# called. Doing wx window creation in OnPreInit() seems to
199
+
# resolve the problem (Issue #350).
200
+
if MAC and wx.version().startswith("4."):
201
+
print("[wxpython.py] OnPreInit: initialize here"
202
+
" (wxPython 4.0 fix)")
203
+
self.initialize()
204
+
194
205
def OnInit(self):
206
+
self.initialize()
207
+
return True
208
+
209
+
def initialize(self):
210
+
if self.is_initialized:
211
+
return
212
+
self.is_initialized = True
195
213
self.create_timer()
196
214
frame = MainFrame()
197
215
self.SetTopWindow(frame)
198
216
frame.Show()
199
-
return True
200
217
201
218
def create_timer(self):
202
219
# See also "Making a render loop":
Original file line number Diff line number Diff line change
@@ -242,6 +242,8 @@ def get_python_include_path():
242
242
try_dirs = ["{base_dir}/include",
243
243
"{base_dir}/../include/python{ver}",
244
244
"{base_dir}/../include/python{ver}*",
245
+
("{base_dir}/../Frameworks/Python.framework/Versions/{ver}"
246
+
"/include/python{ver}*"),
245
247
"/usr/include/python{ver}"]
246
248
ver_tuple = sys.version_info[:2]
247
249
ver = "{major}.{minor}".format(major=ver_tuple[0], minor=ver_tuple[1])
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4