I am creating a window that will be quite long, and I want to have a scrollbar to be able to scroll vertically through the window (it's a settings window). I know how to have a scrollbar scroll vertically through the contents of a text widget, and I tried applying the same to this, but it didn't work:
from tkinter import *
root = Tk()
frame = Frame(root)
scroll = Scrollbar(root)
frame.pack(side = LEFT, fill = BOTH, expand = True)
scroll.pack(side = RIGHT)
frame.config(yscrollcommand = scroll.set)
scroll.config(command = frame.yview)
root.mainloop()
With a text widget, this worked fine, but with a frame widget, as above, it gave me an error saying that frame had no attribute called yscrollcommand
.
Is there any way I can do this?