I have problem: when I try to update Label's text, which was initialized from .kv, it ovelaps original and doesn't metter how many times I update it or will I try to clear it, the only working method is initialize Label's text from App build method (this is example from 32nd exercise youtube lesson: https://www.youtube.com/watch?v=Wu7kTFZtM6I):
ExampleApp.kv example:
# Spinner example exercise 32
<CustomLayout>:
BoxLayout:
orientation: "vertical"
size: root.width, root.height
Label:
id: click_label
text: "Issuer"
font_size: 22
Spinner:
id: spinner_id
text: "Issuer"
values: ["ip1", "ip2", "ip3", "ip4"]
on_text: root.spinner_clicked(spinner_id.text) # here Label's text updates
BoxLayout:
Python 3's script example (example.py):
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.lang import Builder
# Spinner example exercise 32
Builder.load_file("ExampleApp.kv")
class CustomLayout(Widget):
# here Label's text updates
def spinner_clicked(self, value):
self.ids.click_label.text = f"Issuer: {value}"
class ExampleApp(App):
def build(self):
# These 3 strings works correctly
# main_widget = CustomLayout()
# main_widget.ids.click_label.text = "Issuer: ???"
# return main_widget
# This one - not
return CustomLayout()
if __name__ == '__main__':
ExampleApp().run()
my kivy packages:
Kivy==2.1.0
kivy-deps.angle==0.3.2
kivy-deps.glew==0.3.1
kivy-deps.sdl2==0.4.5
Kivy-examples==2.1.0
Kivy-Garden==0.1.5

