Hi I have a code where I have a button which adds calender widgets, when I add more than 10 or 11 widgets, the program lags a lot. It takes a lot of time to insert the widget, could someone please help me how to circumvent this issue ?
from tkinter import Button, Tk
from tkcalendar import DateEntry
root = Tk()
Date = []
def Add():
Date.append({})
n = len(Date)-1
Date[n]= DateEntry(root)
Date[n].grid(row=n+1, column=0)
print (n)
button = Button(root, text='Add', command=Add).grid(row=0, column=0)
When I add
root.mainloop()
to the end of your example the code runs fine.Make sure you have the mainloop in your code before you compile as it is required.