title: Kivy: Why Button is losing its property in case 2?
body: <p><em><strong>This question seems long but isn't. Just added code and corresponding logs for viewers reference.</strong></em></p>
  <p>I'm experimenting with Clock.schedule_interval.</p>
  <p><strong>Objective</strong>: <em>Upon button press, label text initially 0 will be increment 10 times.</em></p>
  <p>I have written this in 2 ways. case 1 works fine. case 2 (few edit in case 1 code) losing button on_press property.</p>
  <p>case 1:</p>
  <pre><code>from kivy.app import App
  from kivy.lang import Builder
  from kivy.uix.widget import Widget
  from kivy.properties import ObjectProperty, ListProperty
  from kivy.clock import Clock, _default_time as time
  
  kv = '''
  Some:
      target: target
      tick: tick
      
      id: tick
      
      BoxLayout:
          orientation: 'vertical'
          size: root.width, root.height
          
          Label:
              id: target
              text: '0'
              font_size: 32
              size_hint: 1, .5
              
          Button:
              text: 'Change'
              on_press: 
                  root.chik.extend(range(int(target.text)+1, int(target.text)+ 11))
                  app.con.extend([root.change] * 10)
  '''
  
  class Some(Widget):
      
      target = ObjectProperty(None)
      tick = ObjectProperty(None)
      chik = ListProperty([])
      
      def __init__(self, **kwargs):
          Widget.__init__(self, **kwargs)
      
      def change(self):
          print(f'From widget: {self.chik} and Label text: {self.target.text}')
          if self.chik:
              self.target.text = str(self.chik.pop(0))
  
  class TestingApp(App):
      
      con = ListProperty([])
      
      def build(self):
          Clock.schedule_interval(self.consume, 1)
          return Builder.load_string(kv)
      
      def consume(self, *args):
          print(f'from app: {self.con}')
          if self.con:
              self.con.pop(0)()
      
  if __name__ == &quot;__main__&quot;:
      TestingApp().run()
  
  </code></pre>
  <p>Log 1:</p>
  <pre><code>[INFO   ] [Base        ] Start application main loop
  from app: []
  [INFO   ] [GL          ] NPOT texture support is available
  from app: []
  from app: []
  from app: []
  from app: []
  from app: [&lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method 
  Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;]
  From widget: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and Label text: 0
  from app: [&lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method 
  Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;]
  From widget: [2, 3, 4, 5, 6, 7, 8, 9, 10] and Label text: 1
  from app: [&lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method 
  Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;]
  From widget: [3, 4, 5, 6, 7, 8, 9, 10] and Label text: 2
  from app: [&lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method 
  Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;]
  From widget: [4, 5, 6, 7, 8, 9, 10] and Label text: 3
  from app: [&lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method 
  Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;]
  From widget: [5, 6, 7, 8, 9, 10] and Label text: 4
  from app: [&lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method 
  Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;]
  From widget: [6, 7, 8, 9, 10] and Label text: 5
  from app: [&lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method 
  Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;]
  From widget: [7, 8, 9, 10] and Label text: 6
  from app: [&lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method 
  Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;]
  From widget: [8, 9, 10] and Label text: 7
  from app: [&lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;, &lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;]
  From widget: [9, 10] and Label text: 8
  from app: [&lt;bound method Some.change of &lt;__main__.Some object at 0x000001DFFDFA5040&gt;&gt;]
  From widget: [10] and Label text: 9
  from app: []
  from app: []
  from app: []
  from app: []
  from app: []
  from app: []
  from app: []
  from app: []
  from app: []
  [INFO   ] [Base        ] Leaving application in progress...
  </code></pre>
  <p><strong>Works fine and providing desired output</strong></p>
  <p>case 2 with <code>print(self.target.text)</code> produce error in <code>def change:</code></p>
  <pre><code>rom kivy.app import App
  from kivy.lang import Builder
  from kivy.uix.widget import Widget
  from kivy.properties import ObjectProperty, ListProperty
  from kivy.clock import Clock, _default_time as time
  
  kv = '''
  Some:
      target: target
      tick: tick
      
      id: tick
      
      BoxLayout:
          orientation: 'vertical'
          size: root.width, root.height
          
          Label:
              id: target
              text: '0'
              font_size: 32
              size_hint: 1, .5
              
          Button:
              text: 'Change'
              on_press: 
                  root.chik.extend(range(int(target.text)+1, int(target.text)+ 11))
                  # app.con.extend([root.change]*10) removed
  '''
  
  class Some(Widget):
      
      target = ObjectProperty(None)
      tick = ObjectProperty(None)
      chik = ListProperty([])
      
      def __init__(self, **kwargs):
          Widget.__init__(self, **kwargs)
      
      def change(self):
          print(f'From widget: {self.chik} and Label text: {self.target.text}') # Error here
          if self.chik:
              self.target.text = str(self.chik.pop(0))
  
  class TestingApp(App):
      
      # con = ListProperty([]) deleted
          
      def build(self):
          self.Some = Some() # Change here
          Clock.schedule_interval(self.consume, 1) 
          return Builder.load_string(kv)
      
      def consume(self, *args):
          self.get_running_app().Some.change() # Change here
      
  if __name__ == &quot;__main__&quot;:
      TestingApp().run()
  </code></pre>
  <p>Log 2 with <code>print(self.target.text)</code> in <code>def change:</code>.</p>
  <pre><code>[INFO   ] [Base        ] Start application main loop
  [INFO   ] [Base        ] Leaving application in progress...
   Traceback (most recent call last):
     File &quot;e:\Search_GUI\practice.py&quot;, line 58, in &lt;module&gt;
       TestingApp().run()
     File &quot;E:\Search_GUI\search_env\lib\site-packages\kivy\app.py&quot;, line 950, in run
       runTouchApp()
     File &quot;E:\Search_GUI\search_env\lib\site-packages\kivy\base.py&quot;, line 582, in runTouchApp
       EventLoop.mainloop()
     File &quot;E:\Search_GUI\search_env\lib\site-packages\kivy\base.py&quot;, line 347, in mainloop
       self.idle()
     File &quot;E:\Search_GUI\search_env\lib\site-packages\kivy\base.py&quot;, line 387, in idle
       Clock.tick()
     File &quot;E:\Search_GUI\search_env\lib\site-packages\kivy\clock.py&quot;, line 733, in tick
       self.post_idle(ts, self.idle())
     File &quot;E:\Search_GUI\search_env\lib\site-packages\kivy\clock.py&quot;, line 776, in post_idle
       self._process_events()
     File &quot;kivy\_clock.pyx&quot;, line 616, in kivy._clock.CyClockBase._process_events
     File &quot;kivy\_clock.pyx&quot;, line 649, in kivy._clock.CyClockBase._process_events
     File &quot;kivy\_clock.pyx&quot;, line 645, in kivy._clock.CyClockBase._process_events
     File &quot;kivy\_clock.pyx&quot;, line 218, in kivy._clock.ClockEvent.tick
     File &quot;e:\Search_GUI\practice.py&quot;, line 55, in consume
       self.get_running_app().Some.change() # Change here
     File &quot;e:\Search_GUI\practice.py&quot;, line 41, in change
       print(f'From widget: {self.chik} and Label text: {self.target.text}')
   AttributeError: 'NoneType' object has no attribute 'text'
  </code></pre>
  <p>case 2 without <code>print(self.target.text)</code>:</p>
  <pre><code>from kivy.app import App
  from kivy.lang import Builder
  from kivy.uix.widget import Widget
  from kivy.properties import ObjectProperty, ListProperty
  from kivy.clock import Clock, _default_time as time
  
  kv = '''
  Some:
      target: target
      tick: tick
      
      id: tick
      
      BoxLayout:
          orientation: 'vertical'
          size: root.width, root.height
          
          Label:
              id: target
              text: '0'
              font_size: 32
              size_hint: 1, .5
              
          Button:
              text: 'Change'
              on_press: 
                  root.chik.extend(range(int(target.text)+1, int(target.text)+ 11))
                  # app.con.extend([root.change]*10) removed
  '''
  
  class Some(Widget):
      
      target = ObjectProperty(None)
      tick = ObjectProperty(None)
      chik = ListProperty([])
      
      def __init__(self, **kwargs):
          Widget.__init__(self, **kwargs)
      
      def change(self):
          print(f'From widget: {self.chik}')
          if self.chik:
              self.target.text = str(self.chik.pop(0))
  
  class TestingApp(App):
      
      # con = ListProperty([]) deleted
          
      def build(self):
          self.Some = Some() # Change here
          Clock.schedule_interval(self.consume, 1) 
          return Builder.load_string(kv)
      
      def consume(self, *args):
          self.get_running_app().Some.change() # Change here
      
  if __name__ == &quot;__main__&quot;:
      TestingApp().run()
  </code></pre>
  <p>log 2 without <code>print(self.target.text)</code>:</p>
  <pre><code>[INFO   ] [Base        ] Start application main loop
  From widget: []
  [INFO   ] [GL          ] NPOT texture support is available
  From widget: []
  From widget: []
  From widget: []
  From widget: []
  From widget: []
  From widget: []
  From widget: []
  From widget: []
  [INFO   ] [Base        ] Leaving application in progress...
  </code></pre>
  <p><strong>For Above Case, Nothing is happening when Button was pressed</strong></p>
  <p><em><strong>I want to know why behaves like that? how should get my code working for case 2 like case 1 did?</strong></em></p>