def _combo(self, parent, model, label):
        """ Creates the switcher combo box. """

        sizer = wx.BoxSizer(wx.HORIZONTAL)

        # Label.
        if label is not None:
            text = wx.StaticText(parent, -1, label)
            sizer.Add(text, 0, wx.ALIGN_CENTER | wx.ALL, 5)

        # Combo.
        self.combo = combo = wx.ComboBox(
            parent,
            -1,
            style=wx.CB_DROPDOWN | wx.CB_READONLY
        )
        sizer.Add(combo, 1, wx.EXPAND | wx.ALIGN_CENTER | wx.ALL, 5)

        # Ask the model for the available options.
        items = model.items
        if len(items) > 0:
            for name, data in model.items:
                combo.Append(name, data)

        # Listen for changes to the selected item.
        wx.EVT_COMBOBOX(self, combo.GetId(), self._on_combobox)

        # If the model's selected variable has been set ...
        if model.selected != -1:
            combo.SetSelection(model.selected)

        return sizer
dataset/ETHPy150Open enthought/pyface/pyface/wx/switcher.py/SwitcherControl._combo/original