2011-07-28 17 views

答えて

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() 
あります
関連する問題