Python论坛  - 讨论区

标题:[python-chinese] wxListCtrl插入数据后不能显示

2008年01月08日 星期二 16:10

zinicl zinicl在gmail.com
星期二 一月 8 16:10:10 HKT 2008

        self.list = wx.ListCtrl(self, -1, style =
wx.LC_REPORT|wx.LC_HRULES|wx.LC_VRULES|wx.NO_BORDER)
        box.Add(self.list, 1, wx.EXPAND)
        self.SetSizer(box)

        self.list.InsertColumn(0, 'a1')
        self.list.InsertColumn(1, 'a2')

        self.list.SetColumnWidth(0, wx.LIST_AUTOSIZE_USEHEADER)
        self.list.SetColumnWidth(1, wx.LIST_AUTOSIZE_USEHEADER)

#µ½ÕâÀïµÄÏÔʾ¶¼ÊÇÕý³£µÄ

        while True:
                ........
                idx = self.list.InsertStringItem(sys.maxint, path)
                self.list.SetStringItem(idx, 1, str(items[0]))
                self.list.SetStringItem(idx, 2, str(items[1]))
                ........

#µ½ÕâÀïÒÔºóÁ¬head¶¼²»ÏÔʾÈκÎÎÄ×ÖÁË£¬listÀïÃæÃ»ÓÐÈκÎÊý¾Ý
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080108/473e064c/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月08日 星期二 16:59

limodou limodou在gmail.com
星期二 一月 8 16:59:03 HKT 2008

On Jan 8, 2008 4:10 PM, zinicl <zinicl在gmail.com> wrote:
>         self.list = wx.ListCtrl(self, -1, style =
> wx.LC_REPORT|wx.LC_HRULES|wx.LC_VRULES|wx.NO_BORDER)
>         box.Add(self.list, 1, wx.EXPAND)
>         self.SetSizer(box)
>
>         self.list.InsertColumn(0, 'a1')
>         self.list.InsertColumn(1, 'a2')
>
>         self.list.SetColumnWidth(0, wx.LIST_AUTOSIZE_USEHEADER)
>         self.list.SetColumnWidth(1, wx.LIST_AUTOSIZE_USEHEADER)
>
> #到这里的显示都是正常的
>
>         while True:
>                 ........
>                 idx = self.list.InsertStringItem(sys.maxint, path)
>                 self.list.SetStringItem(idx, 1, str(items[0]))
>                 self.list.SetStringItem(idx, 2, str(items[1]))
>                 ........
>
> #到这里以后连head都不显示任何文字了,list里面没有任何数据
>
只有两个,怎么插入三列呢?是不是报错了。

-- 
I like python!
UliPad <>: http://code.google.com/p/ulipad/
meide <>: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号