How to create a multiline entry with tkinter?

前端 未结 1 490
不思量自难忘°
不思量自难忘° 2020-12-14 07:21

Entry widgets seem only to deal with single line text. I need a multiline entry field to type in email messages.

Anyone has any idea how to do that?

相关标签:
1条回答
  • 2020-12-14 08:14

    You could use the Text widget:

    from tkinter import *
    
    root = Tk()
    text = Text(root)
    text.pack()
    root.mainloop()
    

    Or with scrolling bars using ScrolledText:

    from tkinter import *
    from tkinter.scrolledtext import ScrolledText
    
    root = Tk()
    ScrolledText(root).pack()
    root.mainloop()
    
    0 讨论(0)
提交回复
热议问题