I need to have checkbuttons inside a scrolled text widget, one checkbutton per row and some text behind each button. I found this solution an stackoverflow:
Tkinter checkbuttons inside of a Text widget and scrolling
Here's a code snipped:
for i in range(1000):
bg = 'grey'
if i % 2 == 0:
bg = 'white'
cb = tk.Checkbutton(text="checkbutton #%s" % i, bg=bg, width=35, justify=tk.LEFT)
text.window_create("end", window=cb)
text.insert("end", "\n") # to force one checkbox per line
This doesn't make much sense to me because while the checkbuttons are displayed correctly you don't have access to each of them. Or am I wrong?