Skip to content

Commit e906a98

Browse files
committed
Fix Mac wxpython example exiting with error code 255 (cztomczak#162)...
Add comment about tkinter_.py example not working on Mac. Delete deprecated Mac examples.
1 parent de76641 commit e906a98

File tree

6 files changed

+10
-1699
lines changed

6 files changed

+10
-1699
lines changed

examples/tkinter_.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Example of embedding CEF Python browser using Tkinter toolkit.
22
# This example has two widgets: a navigation bar and a browser.
33
#
4+
# NOTE: This example doesn't work on Mac, details in Issue #306.
5+
#
46
# Tested configurations:
5-
# - Tk 8.6 and CEF Python v55.3+ on Linux
6-
# - Tk 8.5 and CEF Python v55.4+ on Windows
7+
# - Tk 8.5 on Windows
8+
# - Tk 8.6 on Linux
9+
# - CEF Python v55.3+
710
#
811
# Known issue on Linux: When typing url, mouse must be over url
912
# entry widget otherwise keyboard focus is lost (Issue #255
@@ -41,7 +44,7 @@ def main():
4144
logger.addHandler(stream_handler)
4245
logger.info("CEF Python {ver}".format(ver=cef.__version__))
4346
logger.info("Python {ver}".format(ver=sys.version[:6]))
44-
logger.info("Tk {ver}".format(ver=tk.TkVersion))
47+
logger.info("Tk {ver}".format(ver=tk.Tcl().eval('info patchlevel')))
4548
assert cef.__version__ >= "55.3", "CEF Python v55.3+ required to run this"
4649
sys.excepthook = cef.ExceptHook # To shutdown all CEF processes on error
4750
cef.Initialize()

examples/wxpython.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ def OnClose(self, event):
144144
g_count_windows -= 1
145145
if g_count_windows == 0:
146146
cef.Shutdown()
147-
wx.GetApp().Exit()
147+
wx.GetApp().ExitMainLoop()
148+
# Call _exit otherwise app exits with code 255 (Issue #162).
149+
# noinspection PyProtectedMember
150+
os._exit(0)
148151
else:
149152
# Calling browser.CloseBrowser() and/or self.Destroy()
150153
# in OnClose may cause app crash on some paltforms in
@@ -160,7 +163,6 @@ def clear_browser_references(self):
160163

161164

162165
class FocusHandler(object):
163-
164166
def OnGotFocus(self, browser, **_):
165167
# Temporary fix for focus issues on Linux (Issue #284).
166168
if LINUX:

src/mac/deprecated_64bit/prism.css

Lines changed: 0 additions & 130 deletions
This file was deleted.

src/mac/deprecated_64bit/prism.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)