I'm new with kivy.
I've recently made the first simple applications. From the various online documentation I noticed that there is a command that always varies according to the interpretation of the developers. I'll give a simple example:
class ShowApp(thisParameterWillCompletelyChangeYourLife):
def __init__(self, **kwargs):
super(ShowApp, self).__init__(**kwargs)
def listenerOfAButton(self):
print("Reconized...")
def listenerOfAnotherButton(self):
print("Reconized it also...")
class myApp(App):
def build(self):
return ShowApp()
if __name__ == "__main__":
myApp().run()
kv sample file:
<ShowApp>:
Label:
id: labelIdentifier
text: "Hello World"
I wonder... regardless of the fact that the name of the ShowApp class must be equal to <ShowApp>
in the kv file, which parameter must be passed to that class that takes care of generating all the layout that is included in the kv file?
In my example I called it thisParameterWillCompletelyChangeYourLife, and it is precisely with regard to this input that I did not understand the will of the documents about kivy read so far.
Can someone explain to me what parameter should be passed (and what is it for) to the function that generates the 'app' in the building phase?
Many thanks in advance!
What you are calling thisParameterWillCompletelyChangeYourLife
is the base class for your ShowApp
class. It is not a parameter to be passed in. It can be any class or nothing. In your use it is likely to be a Widget
or perhaps a Layout
class. As written, your ShowApp
is trying to extend a class named thisParameterWillCompletelyChangeYourLife
.
See this documentation