Python GUI编程(Tkinter)6、Text控件


import tkinter

#创建主窗口
win = tkinter.Tk()
#设置标题
win.title("sunck")
#设置大小和位置
win.geometry("400x400+200+20")

'''
文本控件,用于显示多行文本
'''

#height显示的行数
text = tkinter.Text(win, width=30, height=4)
text.pack()
str = '''If there is anyone out there who still doubts that America is a place where all things are possible, who still wonders if the dream of our founders is alive in our time, who still questions the power of our democracy, tonight is your answer'''
text.insert(tkinter.INSERT, str)

win.mainloop()


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM