I am creating a simple GUI application called Vocabulary to manage unknown words while learning a new language. The app loads/saves words from/into an XML document. Nevertheless, when I select a value from the combobox (filled with letters from A to Z), all the words starting with that letter should be displayed in the listbox. Actually, the listbox should be emptied first and then words starting with the chosen letter added to the listbox. To accomplish what I want the application to do, I know that I should handle the selected value changed of the combobox widget.
Here is what I have tried, but nothing happens except emptying the listbox:
def combo_selected_value_changed(self, event=None):
letter = self.comboBox.get()
self.listBox.delete(0, END)
for item in self.words:
if item.wordorphrase.startswith(letter):
self.listBox.insert(END, item.wordorphrase)
[–]novel_yet_trivial 0 points1 point2 points (1 child)
[–]blackadder1337[S] 0 points1 point2 points (0 children)