How do I scroll two commands text1
and text2
? Help me please.
from tkinter import *
root = Tk()
root.title('Text editor')
root.geometry(1000x500)
text_scroll = Scrollbar(frame)
text_scroll.pack(side=RIGHT, fill=Y)
text = Text(root, width=500, height=250, font=font, fg="white", bg="gray10", selectbackground="black", selectforeground="gray", insertbackground="white", undo=True, yscrollcommand=text_scroll.set, wrap="word")
text.pack(expand="yes", fill=BOTH)
text2 = Text(root, width=500, height=250, font=font, fg="white", bg="gray10", selectbackground="black", selectforeground="gray", insertbackground="white", undo=True, wrap="word")
text2.pack(expand="yes", fill=BOTH)
root.mainloop()