I am a little new to tkinter in Python 3 and I am trying to create a scroll bar to work with many widgets like Labels and Radio Buttons. What I have works so far but the scrolling only works when I hover the scroll bar. I would like to get it to work everywhere in the window.
I found another post in Tkinter scroll bar not scrolling with the same issue as me but trying the solution did not solve my problem.
Here is a very dummed down example of what I am trying to produce
import tkinter as tk
root = tk.Tk()
canvas = tk.Canvas(root)
scrolly = tk.Scrollbar(root, orient='vertical', command=canvas.yview)
for i in range(60):
label = tk.Label(canvas, text=i)
canvas.create_window(0, 20 * i, window=label)
canvas.configure(scrollregion=canvas.bbox('all'), yscrollcommand=scrolly.set)
canvas.pack(fill='both', expand=True, side='left')
scrolly.pack(fill='y', side='right')
root.mainloop()
I would like to be able to scroll the page without having to hover on the scroll bar
Thank you for the help in advance