def _update(self, value): maxval = self.maxval if maxval == 0: Ctl.IdleControls(self.w) else: if maxval > 32767: value = int(value / (maxval / 32767.0)) maxval = 32767 maxval = int(maxval) value = int(value) progbar = self.d.GetDialogItemAsControl(3) progbar.SetControlMaximum(maxval) progbar.SetControlValue(value) ready, ev = Evt.WaitNextEvent(Events.mDownMask, 1) if ready: what, msg, when, where, mod = ev part = Win.FindWindow(where)[0] if Dlg.IsDialogEvent(ev): ds = Dlg.DialogSelect(ev) if ds[0] and ds[1] == self.d and ds[-1] == 1: self.w.HideWindow() self.w = None self.d = None raise KeyboardInterrupt, ev elif part == 4: self.w.DragWindow(where, screenbounds) else: MacOS.HandleEvent(ev) return
def do1event(self, mask=Events.everyEvent, wait=0): ok, event = self.app.getevent(mask, wait) if Dlg.IsDialogEvent(event): if self.app.do_dialogevent(event): return if ok: self.dispatch(event) else: self.app.idle(event)
"""Easy to use dialogs.