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
Beispiel #2
0
"""Easy to use dialogs.