用wx.SingleChoiceDialog创建选择列表对话框

运行效果图:


Python代码:

#!/usr/bin/env python
#-*-encoding:utf-8-*-
'Create ChoiceListDialog Example'

import wx

if __name__=='__main__':

    app=wx.PySimpleApp()

    names=['test1','test2','test3','test4']
    modal=wx.SingleChoiceDialog(None,'what ur name?','title here',names)
    if modal.ShowModal()==wx.ID_OK:
        print 'your name is %s \n' %modal.GetStringSelection()
    modal.Destroy()


你可能感兴趣的:(wxPython)