wxpython 两步构造

上一篇 / 下一篇  2015-09-29 07:18:59 / 个人分类:python

import wx

class ListBoxFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, 'List Box Example',
                size=(250, 200))
        panel = wx.Panel(self, -1)

        sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
                      'six', 'seven', 'eight', 'nine', 'ten', 'eleven',
                      'twelve', 'thirteen', 'fourteen111111111']

        #listBox = wx.ListBox(panel, -1, (20, 20), (80, 120), sampleList,wx.LB_MULTIPLE)
        listBox = wx.PreListBox()
        listBox.Create(panel, -1, (20, 20), (80, 120), choices = sampleList,style. = wx.LB_MULTIPLE)
        
        #listBox.SetSelection(3)

if __name__ == '__main__':
    app = wx.PySimpleApp()
    ListBoxFrame().Show()
    app.MainLoop()

步骤:1、调用相应的pre函数
2、执行相应的对象的create函数


TAG:

 

评分:0

我来说两句

Open Toolbar