"""
文本控件:用于显示多行文本
"""
import tkinter
win = tkinter.Tk()
win.title('text控件')
win.geometry('400x400')
text = tkinter.Text(win,width=30,height=4)
text.pack()
str1 = 'ahh ta yu duan jian jie shi ke xi,' \
'mei yi ge meng xiang dou zhi de yong yi' \
'shi de ni shuo de dui ji le' \
'wo jin ran wu fa fan bo ' \
'zaijian ba qin aid ' \
'na zhi shi ge meihao de guo qu'
text.insert(tkinter.INSERT,str1)
win.mainloop()
代码示例图:
带滚动条的Text控件:
"""
文本控件:用于显示多行文本
"""
import tkinter
win = tkinter.Tk()
win.title('带滚动条text控件')
#