Question
I am trying to make a text editor in Tkinter. If a large single-line file is opened, it lags massively and stops responding. Is there a way to set a wrap length for a text widget? I have scroll bars and I don't want to have the characters wrap at the end of the text box. I want it to wrap after a certain number of characters.
Is this possible? If so, how can I do it?
I am using Python 3.9.6 on 64-bit Windows 10.
What I have tried
I have tried using wraplength= in the function, but that doesn't work. I have also searched for this question and found nothing.
Code
from tkinter import *
root = Tk()
root.title('Notpad [new file]')
root.geometry('1225x720')
txt = Text(root,width=150,height=40,wrap=NONE)
txt.place(x=0,y=0)
#Buttons here
scr = Scrollbar(root)
scr.pack(side='right',fill='y',expand=False)
txt.config(yscrollcommand=scr.set)
scr.config(command=txt.yview)
scr1 = Scrollbar(root,orient='horizontal')
scr1.pack(side='bottom',fill='x',expand=False)
txt.config(xscrollcommand=scr1.set)
scr1.config(command=txt.xview)
root.mainloop()