test_listctrl.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:magic-card-database 作者: drknotter 项目源码 文件源码
def OnInit(self):
        frame = wx.Frame(None, -1, "Hello from wxPython")

        id=wx.NewId()
        self.list=wx.ListCtrl(frame,id,style=wx.LC_REPORT|wx.SUNKEN_BORDER)
        self.list.Show(True)

        self.list.InsertColumn(0,"Data #1")
        self.list.InsertColumn(1,"Data #2")
        self.list.InsertColumn(2,"Data #3")

        # 0 will insert at the start of the list
        pos = self.list.InsertStringItem(0,"hello")
        # add values in the other columns on the same row
        self.list.SetStringItem(pos,1,"world")
        self.list.SetStringItem(pos,2,"!")

        pos = self.list.InsertStringItem(0,"wat")
        self.list.SetStringItem(pos,1,"um")
        self.list.SetStringItem(pos,2,"wha")

        self.itemDataMap = {
            0: ("hello","world","!"),
            1: ("wat","um","wha")
            }

        LCM.ColumnSorterMixin.__init__(self,3)

        frame.Show(True)
        self.SetTopWindow(frame)
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号