def becomeMainWindow(self): super(Window, self).becomeMainWindow() NSAnimationContext.beginGrouping() NSAnimationContext.currentContext().setTimingFunction_(CAMediaTimingFunction.functionWithName_(kCAMediaTimingFunctionEaseInEaseOut)) NSAnimationContext.currentContext().setDuration_(0.2) self.animator().setAlphaValue_(1) NSAnimationContext.endGrouping()
def fadeOut(self): global dismissing if dismissing: return dismissing = True NSAnimationContext.beginGrouping() NSAnimationContext.currentContext().setTimingFunction_(CAMediaTimingFunction.functionWithName_(kCAMediaTimingFunctionEaseInEaseOut)) NSAnimationContext.currentContext().setDuration_(0.2) self.animator().setAlphaValue_(0.0) NSAnimationContext.endGrouping() NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(0.21, app, "terminate:", None, False)