I have the following code:
tabControl = Notebook(root)
tab0 = Frame(tabControl)
tab0.pack(fill="both")
tabControl.add(tab0, text="Wardrobe")
tab1 = Frame(tabControl)
tab1.pack(fill='both')
tabControl.add(tab1, text='Weapons', state='normal')
tab2 = Frame(tabControl)
tab2.pack(fill='both')
tabControl.add(tab2, text='Ammo', state='normal')
tabControl.pack(expand=1, fill="both")
# determine canvas
w = 1000
h = 1500
canvas = Canvas(tab0, width=w, height=h, relief='ridge', scrollregion=(0, 0, w, h), highlightthickness=0)
sbar = Scrollbar(tab0, orient=VERTICAL)
sbar.pack(side=RIGHT, fill=Y)
sbar.config(command=canvas.yview)
canvas.config(width=w, height=h)
canvas.config(yscrollcommand=sbar.set)
canvas.pack(side=LEFT, expand=True, fill=BOTH)
# WARDROBE
# photos
planep = PhotoImage(file='images/plane pic.png')
plane = Label(canvas, image=planep)
plane.pack()
plane.place(relx=0.3, y=100, anchor='center')
I managed to get the scrollbar moving but when I "scroll" nothing really happens on the screen except the scrollbar moving (image labels are staying in the same place all the time). I also added an example of adding an image label to it since I think the problem lies in determining y=100
in placing the plane picture.
Does anyone have an idea what should I do?
Thanks in advance.