()
| 89 | |
| 90 | |
| 91 | def main(): |
| 92 | check_versions() |
| 93 | sys.excepthook = cef.ExceptHook # To shutdown all CEF processes on error |
| 94 | settings = {} |
| 95 | if MAC: |
| 96 | # Issue #442 requires enabling message pump on Mac |
| 97 | # in Qt example. Calling cef.DoMessageLoopWork in a timer |
| 98 | # doesn't work anymore. |
| 99 | settings["external_message_pump"] = True |
| 100 | |
| 101 | cef.Initialize(settings) |
| 102 | app = CefApplication(sys.argv) |
| 103 | main_window = MainWindow() |
| 104 | main_window.show() |
| 105 | main_window.activateWindow() |
| 106 | main_window.raise_() |
| 107 | app.exec_() |
| 108 | if not cef.GetAppSetting("external_message_pump"): |
| 109 | app.stopTimer() |
| 110 | del main_window # Just to be safe, similarly to "del app" |
| 111 | del app # Must destroy app object before calling Shutdown |
| 112 | cef.Shutdown() |
| 113 | |
| 114 | |
| 115 | def check_versions(): |
no test coverage detected