You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
948 B
Python
29 lines
948 B
Python
2 years ago
|
import kivy
|
||
|
from kivy.app import App
|
||
|
from kivy.uix.label import Label
|
||
|
from kivy.uix.gridlayout import GridLayout
|
||
|
from kivy.uix.textinput import TextInput
|
||
|
from kivy.uix.button import Button
|
||
|
from kivy.uix.widget import Widget
|
||
|
from kivy.properties import ObjectProperty
|
||
|
|
||
|
class MainScreen(Widget):
|
||
|
kv_text1 = ObjectProperty(None)
|
||
|
kv_text2 = ObjectProperty(None)
|
||
|
|
||
|
def btn_press(self):
|
||
|
print("Text1: {}, Text2: {}".format(self.kv_text1.text,self.kv_text2.text))
|
||
|
|
||
|
class MyApp(App):
|
||
|
def build(self):
|
||
|
return MainScreen()
|
||
|
"""
|
||
|
*hinweis namensgebung wenn mit kv gearbeitet wird:
|
||
|
.kv datei muss heißen wie diese class AUßER: immer in lower case UND wenn es endet auf ...App dann wird App geschluckt aus dem namen
|
||
|
beispiel:
|
||
|
class MyApp arbeitet mit my.kv
|
||
|
class ABCAndroidDing arbeitet mit abcandroidding.kv
|
||
|
"""
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
MyApp().run()
|