Dynamically create combox and reset values TKinter

You are setting comblist to a list of strings. If you want to iterate over comboboxes you need to iterate over the comboboxes, not strings.

There are many ways to do this. In your specific case it’s probably easiest to just get rid of the original definition of comblist and replace it with a list of comboxes.

comblist = []
for i in range(4):        
    comb= ttk. Combobox(root, values=value1, state="readonly")
    comblist.append(comb)
    ...

With that, your code to iterate over comblist will work:

 for cmb1 in comblist:   
     cmb1.set("None")

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top