Esempio n. 1
0
def wait():
    from Carbon import Evt
    from Carbon import Events
    global splash
    try:
        splash
    except NameError:
        return
    Qd.InitCursor()
    time = Evt.TickCount()
    whattext = 0
    drawtext(whattext)
    while _keepsplashscreenopen:
        ok, event = Evt.EventAvail(Events.highLevelEventMask)
        if ok:
            # got apple event, back to mainloop
            break
        ok, event = Evt.EventAvail(Events.mDownMask | Events.keyDownMask
                                   | Events.updateMask)
        if ok:
            ok, event = Evt.WaitNextEvent(
                Events.mDownMask | Events.keyDownMask | Events.updateMask, 30)
            if ok:
                (what, message, when, where, modifiers) = event
                if what == Events.updateEvt:
                    if Win.WhichWindow(message) == splash:
                        UpdateSplash(1, whattext)
                else:
                    break
        if Evt.TickCount() - time > 360:
            whattext = not whattext
            drawtext(whattext)
            time = Evt.TickCount()
    del splash
Esempio n. 2
0
 def idle(self, *args):
     if self.movie:
         if not self.movie.IsMovieDone() and self.running:
             Qd.ObscureCursor()
             while 1:
                 self.movie.MoviesTask(0)
                 gotone, event = Evt.EventAvail(Events.everyEvent)
                 if gotone or self.movie.IsMovieDone():
                     break
         elif self.running:
             box = self.movie.GetMovieBox()
             self.SetPort()
             self.GetWindow().InvalWindowRect(box)
             self.movie = None
             self.running = 0