#coding: utf-8


#wx.Choiceの例題:複数の選択肢から一つを選択する

import wx

choiceList=['せり','なずな','ごぎょう','はこべら','ほとけのざ',
            'すずな','すずしろ']


class Example(wx.Frame):

    def __init__(self, *args, **kw):
        super(Example, self).__init__(*args, **kw)

        self.SetSize((150,250))

        self.InitUI()

    def InitUI(self):

        panel = wx.Panel(self)
        vbox = wx.BoxSizer(wx.VERTICAL)
        title=wx.StaticText(panel, -1,'春の七草')
        vbox.Add(title, wx.ID_ANY, wx.EXPAND | wx.ALL, 20)
        self.disp=wx.StaticText(panel, -1,label='')
        vbox.Add(self.disp, wx.ID_ANY, wx.EXPAND | wx.ALL, 20)
        self.choice=wx.Choice(panel, -1, choices=choiceList)
        self.choice.SetSelection(1)
        vbox.Add(self.choice, wx.ID_ANY, wx.EXPAND | wx.ALL, 20)

        self.choice.Bind(wx.EVT_CHOICE, self.OnChoice)

        panel.SetSizer(vbox)
        self.SetTitle('Choice')
        self.Centre()

    def OnChoice(self, event):
        choice = event.GetEventObject()
        n = choice.GetSelection()
        self.disp.SetLabel(choice.GetString(n))
        print( choice.GetString(n))


def main():

    app = wx.App()
    ex = Example(None)
    ex.Show()
    app.MainLoop()


if __name__ == '__main__':
    main()

	実行例