Reputation: 481
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
Upvotes: 0
Views: 589
Reputation: 33071
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()
Upvotes: 1
Reputation: 481
Sorry for the question, but I found the solution here.
Cheers Thomas
Upvotes: 1