0

I put the text inside a frame and make those frames scrollable inside the parent frame. I have done a lot of afforts but cannot achieve this the error says. "AttributeError: 'Frame' object has no attribute 'yview'" Is there any way to resolve this?

from tkinter import *
def main():
    window = Tk()
    window.title("TexComp")
    window.geometry("500x500")
    window.resizable(height=FALSE,width=FALSE)
    windowBackground = '#E3DCA8'
    window.configure(bg=windowBackground)
    frameinfo1 = Frame(window, bd=2, bg="white")
    frameinfo1.grid(row=0, column=0, sticky=E + W + N + S)
    instruction = Label(frameinfo1,text="Type or paste your text into one box,\nthen paste the text you want to compare it too\ninto the other one.", bg=windowBackground)
    instruction.grid(row=0,column=0)
    frameinfo2 = Frame(window, bd=2, bg="white")
    frameinfo2.grid(row=1, column=0, sticky=E + W + N + S)
    instruction = Label(frameinfo2,
                        text="Type or paste your text into one box,\nthen paste the text you want to compare it too\ninto the other one.",
                        bg=windowBackground)
    instruction.grid(row=0, column=0)
    frameinfo3 = Frame(window, bd=2, bg="white")
    frameinfo3.grid(row=2, column=0, sticky=E + W + N + S)
    instruction = Label(frameinfo3,
                        text="Type or paste your text into one box,\nthen paste the text you want to compare it too\ninto the other one.",
                        bg=windowBackground)
    instruction.grid(row=0, column=0)
    scroll1y=Scrollbar(window, command=frameinfo1.yview)
    scroll1y.grid(row=0,column=1,rowspan=5)
    mainloop()
if __name__ == '__main__':
    main()
acw1668
  • 40,144
  • 5
  • 22
  • 34

0 Answers0