I was wondering how I fill a wxChoice with content at runtime.
When creating the GUI I do not have the information of the content since it depends on the users what directory to choose.
What am I doing? The user will have to select a directory from a wx.DirDialog. The event handler refers to a function that will search for files of certain type and the results will be returned as a list of strings.
The list of strings should be used to fill/update the wx.Choice widget but I do not how to do this at runtime.
Does anybody has a solution for this problem?
Cheers Thomas
I personally think that SetItems(listOfItems) is the quickest way of doing it and it works for several other widget types as well, such as ComboBox. The answer that Thomas mentions forces the developer to clear the widget and then Append individual items OR use AppendItems to add a list of items. Either way, that's a 2-step process compared with just using SetItems()
Fill wx.Choice at runtime