def exit_handler(e): """When the user leaves, cancel the event.""" # We only want to cancel if the event hasn't expired already nonlocal event_id window.withdraw() if event_id is not None: TK_ROOT.after_cancel(event_id)
def exit_handler(e): """When the user leaves, cancel the event.""" # We only want to cancel if the event hasn't expired already nonlocal event_id hide() if event_id is not None: TK_ROOT.after_cancel( event_id )
def stop(self): """Cancel the music, if it's playing.""" if self.sample is None: return self.sample.pause() self.sample = None self.stop_callback() if self.after is not None: TK_ROOT.after_cancel(self.after) self.after = None