I
I
IgFil2020-01-21 12:39:56
Python
IgFil, 2020-01-21 12:39:56

How to display text in kivy input element in kivy library?

The task is to output the text from the variable to the text_input_2 element every second.
In this case, the text that was displayed before should be saved. The text should be displayed each time on a new line
. I'm new and may need to use a different element to display the text.

def build(self):
        txt_input = TextInput()
        txt_input_2 = TextInput(text=self.data)
        change_text(txt_input_2, period=1, new_text=self.data)
        an1 = AnchorLayout(anchor_x='left', anchor_y="bottom")
        container_body = BoxLayout()
        container_body.add_widget(txt_input_2)
        container_input = BoxLayout(orientation='horizontal', size_hint=[1, .1])
        container_input.add_widget(txt_input)
        btn_input = Button(text="Отправить", size_hint=[.5, 1])
        btn_input.bind(on_press=lambda *a: self.messageShow(txt_input.text, alias))
        container_input.add_widget(btn_input)
        an1.add_widget(container_body)
        an1.add_widget(container_input)
        return an1

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question