Skip to content Skip to sidebar Skip to footer

Combobox Doesn't Display The Populated Values

I created a combobox to show a list of values out of a sqlite database. If I sent the values to the combobox, the list will shown. The problem is, that the field will not filled wi

Solution 1:

Define the list in the __init__() and then populate inside the function, like:

def__init__(self):
    self.cache = []
... # Rest of codesdefshow_name_search(self,event):
....# Rest of codesfor row indata:self.cache.append(row[0])                    

    self.e_business['values'] = self.cache # Set the value to the new listself.e_business.current(0) # Set the first item of the list as current item

To set the item to the current item, you can use current() and the index of the item to be set first. Note that the indentation levels will change according to your class.

Post a Comment for "Combobox Doesn't Display The Populated Values"