I'm creating a GUI using Tkinter with Python 2.7.6.
I have a drop down menu, created and initially disabled with the following code:
self.dropdown = Tkinter.OptionMenu(self, self.dropdownVar, "Select SED...")
self.dropdown.grid(column=0,row=1)
self.dropdown.configure(state="disabled")
After a user selects a directory, I call a function onEnterDir()
which then gets a list of files in that directory. So, I have a list of files in a variable called dirFiles
.
What I want is to then update the options in the dropdown menu with the items in this dirFiles
list. How would I do this?
My question is different to others on here because I just want to update the list of items self.dropdown
displays. It's not dependent on any other widget. I have a python list of things I want to put in. How do I do this?