Abuzz
Abuzz

Reputation: 73

How does one wrap text in kivy python file?

I'm attempting to wrap text in kivy in my label. How would I go about that? I've tried googling it, but I've only seen results in a .kv file. There is a specific reason in why I need to use a python file, so I haven't gotten any leads.

class GUI(App):
    def build(self):
        mainLayout = BoxLayout(orientation="vertical")      
  
        out = Label(text="Output: ", font_size="25dp", color="#00FFCE")
        mainLayout.add_widget(out)
        return mainLayout

if __name__ == "__main__":
    window = GUI()
    window.run()

Upvotes: 1

Views: 138

Answers (1)

John Anderson
John Anderson

Reputation: 39107

Try using \n:

out = Label(text="Output: \nInput", font_size="25dp", color="#00FFCE")

or:

        text = '''
Abba
Dabba
Doo
        '''
        out = Label(text=text, font_size="25dp", color="#00FFCE")

Upvotes: 2

Related Questions