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 codes
def show_name_search(self,event):
....# Rest of codes
for row in data:
self.cache.append(row[0])
self.e_business['values'] = self.cache # Set the value to the new list
self.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"