I have a button in my code which suppose change label text to 'Status: Wait..'
and when done so it should change to 'Status: Done..'
when i press the whole screen get freeze for 1min :
when i press button below method invoke.
(Note:- that variable called
tags
in 3rd line is a list contains around 1000+ strings maybe that's why my app get freez)
But the problem is status.text
never set to 'Status: Wait..'
it directly goes to 'Status: Done..'
**. I mean if it get freez because of 3rd line so at least 2nd should execute first.**
def update_logs(self):
self.ids.status.text = 'Status: Wait..'
for log in tags:
self.ids.logs_grid.add_widget(Label(text=log))
self.ids.status.text = 'Status: Done..'
in 2nd line status is a id of a label which is in kv.
in 4th line logs_grid is a id of gridlayout which is in kv
def update_logs(self):
self.ids.status.text = 'Status: Wait..'
def do_loop(dt):
for log in tags:
self.ids.logs_grid.add_widget(Label(text=log))
self.ids.status.text = 'Status: Done..'
from kivy.clock import Clock
Clock.schedule_once(do_loop)