import kivy
from kivy.app import App
from kivy.properties import ObjectProperty
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
from kivy.uix.scatter import Scatter
from kivy.uix.widget import Widget
class MyLayout(Widget):
txt_input = ObjectProperty(None)
txt_output = ObjectProperty(None)
def press(self):
todo = self.txt_input.text
# update label
self.txt_output.text = todo
class MainApp(App):
def build(self):
return MyLayout()
if __name__ == "__main__":
MainApp().run()
#:kivy 2.0.0
<MyLayout>:
txt_input: txt_input
txt_output: txt_output
BoxLayout:
orientation: 'vertical'
size: root.width, root.height
Scatter:
Label:
id: txt_output
font_size: 150
BoxLayout:
cols: 2
TextInput:
pos: (0,0)
id: txt_input
size_hint_x: .8
size_hint_y: None
font_size: 150
Button:
pos: (1278,0)
size_hint_x: .2
size_hint_y: None
text: "add"
on_press: root.press()
You need to add (append) to the existing string….
self.txt_output.text += todo
You may want to also append a new line character.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/bbb1ff87-704e-4eea-a0d7-23f9357ea8d5o%40googlegroups.com.