Kivy uses an event loop. When you set the text attribute, the screen will not be updated until after kivy returns to the event loop. The way your code is written kivy will not return to the event loop until the after the thread is completed.
You can split creatList into 2 parts and use Clock.schedule_once() to allow kivy to return to the event loop, you will see your updated text on screen.
def creatList(self):
...
self.ids.connect_spanner.text = "Loading..."
Clock.schedule_once(self.continue_create_list)
def continue_create_list(self, _):
creat1 = Thread(...
From: Esra Issam
Sent: Monday, September 12, 2022 3:02 AM
To: Kivy users support
Subject: [kivy-users] editing text in kivy elements
I wrote a function called creatList which is supposed to write loading on the label called conneced_spanner and then create a thread.
but the function does not modify the label until the thread is complete although the line of the modifying comes before the thread, I could not figure out why is this happening.
I need help
thanks in advanced
here is the code
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d0058353-e0ca-40d4-aca2-df8acd0dac5fn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/631f3403.e90a0220.e77b5.1584SMTPIN_ADDED_MISSING%40gmr-mx.google.com.