2010年10月12日 星期二

wxPython 筆記 (RadioBox)

import wx

class RadioBoxFrame(wx.Frame):
#    def __init__(self):
    def __init__(self,parent,id):
        wx.Frame.__init__(self,parent,id, 'Radio Box Example', size=(550, 400))

        panel = wx.Panel(self)
       
        sampleList = ['zero', 'one', 'two', 'three', 'four', 'five','six', 'seven', 'eight']
        wx.RadioBox(panel, -1, "A Radio Box", (10, 10), wx.DefaultSize,sampleList, 2, wx.RA_SPECIFY_COLS)
        wx.RadioBox(panel, -1, "Next Radio Box", (150, 10), wx.DefaultSize,sampleList, 3, wx.RA_SPECIFY_COLS | wx.NO_BORDER)
        wx.RadioBox(panel, -1, "Thrid Radio Box", (350, 10), wx.DefaultSize,sampleList, 1, wx.RA_SPECIFY_COLS | wx.NO_BORDER)
        wx.RadioBox(panel, -1, "Fourth Radio Box", (10, 250), wx.DefaultSize,sampleList, 1, wx.RA_SPECIFY_ROWS | wx.NO_BORDER)

if __name__=='__main__':
    app=wx.PySimpleApp()
    frame=RadioBoxFrame(parent=None,id=-1)
    frame.Show()
    app.MainLoop()

沒有留言: