I want to set the label in a popup to a value which i have already declared in another screen/class. How can i do this?
class ScreenTwo(Screen):
self.result = StringProperty(None)
def Winning(self):
wp = WinningPopup()
wp.open()
class WinningPopup(Popup):
pass
that is a part of the main file which shows the two classes, one a screen one a popup.
<WinningPopup>:
id: winning_popup
Label:
id: winning_label
text: root.parent.ScreenTwo.checkwin.result
this is from the kv file for the popup trying to indicate the value which is held in screentwo for the label text, i´ve tried root.self.ScreenTwo, tried root.checkwin.result, tried all combinations of these but it just gives an error that it cannot find result. How can i link the text in the label to the value stored in screentwo?


This is not correct python syntax also not correct python naming convention. First of all
self.result = StringProperty(None)doesn't make sense. Simplyresult = StringProperty(None). Also function name must be lowercase.