title: Progress bar in kivy can't update using loop
body: <p>im traying to do a progress bar in kivy, i can build the app with it but it can't be udpated when i run a function (loop) how can i do this please ?</p>
  
  <p>here is my code : 
  import libraries :</p>
  
  <pre><code>from kivy.app import App
  
  from kivy.lang import Builder
  from kivy.uix.boxlayout import BoxLayout
  
  from kivy.uix.label import Label
  from kivy.properties import ObjectProperty
  from kivy.core.window import Window
  from kivy.clock import Clock
  from kivy.logger import Logger
  from kivy.uix.progressbar import ProgressBar
  </code></pre>
  
  <p>My builder :</p>
  
  <pre><code>Builder.load_string("""
  &lt;RootWidget&gt;:
      pb : pb
      some code here
          ActionView:       
              ActionPrevious:
                  with_previous: False 
                  ActionButton:
                      text: 'Run analysis'
                      color: 29/255, 185/255, 84/255, 1
                      on_release: root.clicked()
      BoxLayout:
          ProgressBar:
              id : pb
              min :0
              max :1
              pos_hint: {'x': .1}
              size_hint_x :.8
              size_hint_y :.5
              value: 0
          """)
  </code></pre>
  
  <p>other code with my update_bar function:         </p>
  
  <pre><code>class Myapp(BoxLayout):
  
      pb = ProgressBar()
      box = ObjectProperty()
  
      def __init__(self, *args, **kwargs):
          super(Myapp, self).__init__(*args, **kwargs)
  
      def update_bar(self,dt=None):
           self.ids.pb.value = self.ids.pb.value
  </code></pre>
  
  <p>here is the problem : the progress bar is not updated each iteration, but it take the last value (for i = 9999)</p>
  
  <pre><code>     def clicked(self):
          for i in range(10000) :
              self.ids.pb.value =  i/10000 
              Clock.schedule_interval(self.update_bar,0.5)
              self.update_bar()
  </code></pre>
  
  <p>Build my app :     </p>
  
  <pre><code>class EventScreen(App,Myapp):
      def on_stop(self):
          Logger.critical("Good bye")
      def build(self):
          return Myapp()
  if __name__ == "__main__":
      EventScreen().run()
  </code></pre>
  
  <p>thank you in advance </p>