title: un_active button until function finished in kivy
body: <p>I am using kivy for UI. there is a Time_consuming function and when it runs, kivy ui will goes in black, so I used Threading.
  I want to disable buttons until Time_consuming function finishes, and then enable button again. I have been used something like below:</p>
  
  <pre><code>from threading import Thread
  from kivy.clock import Clock
  from functools import partial
  
     def run():
          self.run_button.disabled=True
          self.back_button.disabled=True
  
          t=Thread(target=Time_consuming(), args=())
          t.start()
  
          Clock.schedule_interval(partial(disable, t.isAlive()), 8)
  
      def disable(t, what):
          print(t)
          if not t:
              self.run_button.disabled=False
              self.back_button.disabled=False
  </code></pre>
  
  <p>but this dose not work, t.isAlive()  in disable() even when Time_consuming() finishes, is True. where is the problem ?</p>
  
  <p>question2: another problem is, Clock.schedule_interval will continue to run for ever. how can stop it when function finished?</p>