Filtering through choices
Sometimes, there is a need to present users with the number of times they need to choose some or all of the items. There are several ways to perform this task, one of which is using the ItemsPicker
control. This control allows presenting a list of choices in the ListBox
control and filtering them into another ListBox
control of selections. In this recipe, we will see how to make use of ItemsPicker
to select from a group of choices.
How to do it…
Perform the following steps:
First, let's make a window to hold the
ItemsPicker
control, as follows:class ListMaker(wx.Frame): def __init__(self, parent, choices, title): super(ListMaker, self).__init__(parent, title=title) style = IP.IP_REMOVE_FROM_CHOICES self.picker = IP.ItemsPicker(self, choices=choices, ipStyle=style) style = wx.TE_RICH2|wx.TE_MULTILINE self.txt = wx.TextCtrl(self, style=style) self._DoLayout() self.picker...