ตัวอย่าง
โค้ด: เลือกทั้งหมด
from tkinter import *
root = Tk()
S = Scrollbar(root)
T = Text(root, height=4, width=50)
S.pack(side=RIGHT, fill=Y)
T.pack(side=LEFT, fill=Y)
S.config(command=T.yview)
T.config(yscrollcommand=S.set)
quote = """HAMLET: A text widget is used for multi-line text area.The Tkinter text widget is very powerful and flexible and can be used for a wide range of tasks.Though one of the main purposes is to provide simple multi-line areas, as they are often used in forms, text widgets can also be used as simple text editors or even web browsers. """
T.insert(END, quote)
mainloop( )
ศึกษาจาก :https://www.python-course.eu/tkinter_text_widget.php