我想使用面板中wxMultiChoice对话框中包含的列表(每个项旁边的复选框)。这可能吗?
答案 0 :(得分:0)
相当于wx.MultiChoiceDialog是wx.CheckListBox
import wx
class MyFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent, -1)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
'six', 'seven', 'eight', 'nine', 'ten', 'eleven',
'more', 'and more']
sizer = wx.BoxSizer(wx.HORIZONTAL)
self.clb = wx.CheckListBox(self, -1, (30,30), wx.DefaultSize, sampleList)
self.Bind(wx.EVT_LISTBOX, self.EvtListBox, self.clb)
self.Bind(wx.EVT_CHECKLISTBOX, self.EvtCheckListBox, self.clb)
self.clb.SetSelection(0)
sizer.Add(wx.Panel(self), 1, flag=wx.EXPAND)
sizer.Add(self.clb, 0, flag=wx.EXPAND)
sizer.Add(wx.Panel(self), 1, flag=wx.EXPAND)
self.SetSizer(sizer)
self.Fit()
def EvtListBox(self, event):
pass
def EvtCheckListBox(self, event):
pass
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = MyFrame(None)
frame.Show(True)
app.MainLoop()