Created
August 3, 2019 04:42
-
-
Save sleepless-se/5c4b105605b7e63b5adcebde63db852d to your computer and use it in GitHub Desktop.
Sample: Kiby input text update label with button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Manual_insert>: | |
name: "manual" | |
BoxLayout: | |
TextInput: | |
id: name | |
Label: | |
text: root.text | |
Button: | |
text: "Update" | |
on_release: | |
root.update_info() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.uix.screenmanager import Screen | |
from kivy.properties import StringProperty | |
class Manual_insert(Screen): | |
text = StringProperty('') | |
def update_info(self): | |
self.text = self.ids.name.text | |
print(self.text) | |
class TestApp(App): | |
def build(self): | |
return Manual_insert() | |
if __name__ == "__main__": | |
TestApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment