def start(self):
while self.timeline.is_playing:
time.sleep(1.0/self.timeline.framerate)
self.timeline.on_goto(None,NEXT)
# while has fixed frames jump to the next
while self.timeline.frames[self.timeline.active].fixed:
if not self.timeline.is_replay and self.timeline.active >= len(self.timeline.frames)-1:
self.timeline.on_toggle_play(self.play_button)
self.timeline.on_goto(None,NEXT)
# if all frames is already played, and is no replay, stop the loop.
if not self.timeline.is_replay and self.timeline.active >= len(self.timeline.frames)-1:
self.timeline.on_toggle_play(self.play_button)
# call gtk event handler.
while gtk.events_pending():
gtk.main_iteration()
评论列表
文章目录