vendredi 22 février 2019

tkinter checkbox grid scrolling

in my code i have a script for creating a grid of checkboxes, but now it for certain sizes it is bigger than my second monitor, so i want to be able to scroll to other checkboxes, is there any way to do this?

code:

master = Tk()
numberx = 20
numbery = 20
mylist = []
xgrid = 0;ygrid = 0
for i in range(10000):
    mylist.append(Checkbutton(master, text="  "))
    mylist[i].grid(row=ygrid+1, sticky=W, column=xgrid+1)
    mylist[i].configure(bg='light gray')
    xgrid += 1
    if xgrid == numberx:
        ygrid += 1
        xgrid = 0
    if ygrid == numbery:
        break
master.mainloop()




Aucun commentaire:

Enregistrer un commentaire