13. Tkinter: ScrollText

Опубликовано: 10 Апрель 2026
на канале: Game Design with Reilly
2,699
30

Video code

#Imports the Tkinter Library
from tkinter import*

#Creates a new window
master=Tk()
#Changes the title of the window
master.title("My title")
#Changes the background of the window
master.configure(background='white')
#Changes the size of the window
master.geometry("350x200")

scrText=scrolledtext.ScrolledText(master, wrap=WORD)
scrText.pack()

scrText.insert('insert',"Hello \n\n\n\n\n")
scrText.insert('insert',"Hello \n\n\n\n\n")
scrText.insert('insert',"Hello \n\n\n\n\n")
scrText.insert('insert',"Hello \n\n\n\n\n")
scrText.insert('insert',"Hello \n\n\n\n\n")

scrText.config(state=DISABLED)