Example #1
0
 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)
Example #2
0
 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
         )
Example #3
0
        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
Example #4
0
        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