Good day. My research into the tkinter scrollbar is that the frame I want to scroll must be the child of a canvas. I have looked at many examples and set up this code, however the scrollbar does not seem to scroll. I would very much appreciate if someone could point out where I have gone wrong.
from tkinter import *
def makeUI():
main = Tk()
w=100
h=400
x=100
y=100
main.geometry("%dx%d+%d+%d" % (w, h, x, y))
main.configure(background='#ff0000')
canvas = Canvas(main, width=w, height=h, bg='#00ff00')
canvas.pack(side=RIGHT, fill=BOTH)
frame=Frame(canvas, width=w, height=h, bg = '#0000ff')
frame.pack()
scrollbar = Scrollbar(frame)
scrollbar.pack(side=RIGHT, fill=BOTH)
scrollbar.config(command=canvas.yview )
for n in range(100):
text=Label(frame, text='hello')
text.pack()
main.mainloop()
makeUI()
Thank you.