How to create a multiline entry with tkinter?

2019-02-03 08:36发布

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条回答
爷、活的狠高调
2楼-- · 2019-02-03 08:58

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()
查看更多
登录 后发表回答