def onTimer(self): # The proper way of doing message loop should be: # 1. In createTimer() call self.timer.start(0) # 2. In onTimer() call MessageLoopWork() only when # QtGui.QApplication.instance()->hasPendingEvents() # returns False. # But there is a bug in Qt, hasPendingEvents() returns # always true. # (The behavior described above was tested on Windows # with pyqt 4.8, maybe this is not true anymore, # test it TODO) cefpython.MessageLoopWork()
def _message_loop_work(self, *kwargs): '''Get called every frame. ''' self.count += 1 # print(self.count) cefpython.MessageLoopWork() self.on_mouse_move_emulate() # From Kivy docs: # Clock.schedule_once(my_callback, 0) # call after the next frame # Clock.schedule_once(my_callback, -1) # call before the next frame # When scheduling "after the next frame" Kivy calls _message_loop_work # in about 13ms intervals. We use a small trick to make this 6ms # interval by scheduling it alternately before and after the next # frame. This gives better User Experience when scrolling. # See Issue #240 for more details on OSR performance. if self.count % 2 == 0: Clock.schedule_once(self._message_loop_work, 0) else: Clock.schedule_once(self._message_loop_work, -1)
def OnTimer(self, event): self.timerCount += 1 # print("wxpython.py: OnTimer() %d" % self.timerCount) cefpython.MessageLoopWork()
def OnIdle(self, event): cefpython.MessageLoopWork()
def _on_timer(self): cefpython.MessageLoopWork() return True
def OnTimer(self, event): cefpython.MessageLoopWork()
def OnTimer(self): if self.exiting: return False cefpython.MessageLoopWork() return True
def cef_loop(*largs): cefpython.MessageLoopWork()
cefpython.MessageLoopWork() def stopTimer(self): # Stop the timer after Qt message loop ended, calls to MessageLoopWork() # should not happen anymore. self.timer.stop() if __name__ == '__main__': print("[pyqt.py] PyQt version: %s" % QtCore.PYQT_VERSION_STR) print("[pyqt.py] QtCore version: %s" % QtCore.qVersion()) # Intercept python exceptions. Exit app immediately when exception # happens on any of the threads. sys.excepthook = ExceptHook cefpython.MessageLoopWork() # Application settings settings = { "debug": True, # cefpython debug messages in console and in log_file "log_severity": cefpython.LOGSEVERITY_INFO, # LOGSEVERITY_VERBOSE "log_file": GetApplicationPath("debug.log"), # Set to "" to disable. "release_dcheck_enabled": True, # Enable only when debugging. # This directories must be set on Linux "locales_dir_path": cefpython.GetModuleDirectory() + "/locales", "resources_dir_path":
def _cef_mes(self, *kwargs): '''Get called every frame. ''' cefpython.MessageLoopWork()
def OnIdle(self, event): # self.idleCount += 1 # print("wxpython.py: OnIdle() %d" % self.idleCount) cefpython.MessageLoopWork()
def _onTimer(self, event): """Service CEF message loop""" cefpython.MessageLoopWork()
def _cef_mes(self, *kwargs): '''Get called every frame. ''' if self.displaying: cefpython.MessageLoopWork()