def processWidgetEvents(w, maxEvents=100): import _tkinter as tk from _chimera import restrictEventProcessing restrictEventProcessing(w.winfo_id()) try: for i in range(maxEvents): if not tk.dooneevent(tk.WINDOW_EVENTS | tk.DONT_WAIT): break finally: restrictEventProcessing(0)
def processWidgetEvents(w, maxEvents = 100): import _tkinter as tk from _chimera import restrictEventProcessing restrictEventProcessing(w.winfo_id()) try: for i in range(maxEvents): if not tk.dooneevent(tk.WINDOW_EVENTS|tk.DONT_WAIT): break finally: restrictEventProcessing(0)
def really_tkinteract(self): import _tkinter _tkinter.createfilehandler(self.reader.console.input_fd, _tkinter.READABLE, self.tkfilehandler) self.exc_info = None while 1: # dooneevent will return 0 without blocking if there are # no Tk windows, 1 after blocking until an event otherwise # so the following does what we want (this wasn't expected # to be obvious). if not _tkinter.dooneevent(_tkinter.ALL_EVENTS): self.handle1(block=1) if self.exc_info: type, value, tb = self.exc_info self.exc_info = None _reraise(type, value, tb)
def really_tkinteract(self): import _tkinter _tkinter.createfilehandler( self.reader.console.input_fd, _tkinter.READABLE, self.tkfilehandler) self.exc_info = None while 1: # dooneevent will return 0 without blocking if there are # no Tk windows, 1 after blocking until an event otherwise # so the following does what we want (this wasn't expected # to be obvious). if not _tkinter.dooneevent(_tkinter.ALL_EVENTS): self.handle1(block=1) if self.exc_info: type, value, tb = self.exc_info self.exc_info = None _reraise(type, value, tb)