def asyncevents(self, onoff): if MacOS.runtimemodel == 'macho': raise 'Unsupported in MachoPython' old = self._doing_asyncevents if old: MacOS.SetEventHandler() MacOS.SchedParams(*self.schedparams) if onoff: MacOS.SetEventHandler(self.dispatch) doint, dummymask, benice, howoften, bgyield = self.schedparams MacOS.SchedParams(doint, everyEvent, benice, howoften, bgyield) self._doing_asyncevents = onoff return old
def __del__(self): if self._doing_asyncevents: self._doing_asyncevents = 0 MacOS.SetEventHandler()
"A sort of application framework for the Mac"