开发者

Is there a wxpython list widget that displays alternating row colours even when the list is empty?

开发者 https://www.devze.com 2023-01-07 11:41 出处:网络
Is there a wxpython list widget that displays alternatin开发者_如何学Cg row colours even when empty the list is empty? or Is there even one that will display a background colour(other than white) when

Is there a wxpython list widget that displays alternatin开发者_如何学Cg row colours even when empty the list is empty? or Is there even one that will display a background colour(other than white) when it is empty?


You could do it with a wx.Grid or you might look at the new UltimateListCtrl, which is a pure python widget. You can hack it if it doesn't do what you want it to!


Indeed. Create your list as a custom class:

import wx.lib.mixins.listctrl as listmix

class CustomList(wx.ListCtrl, listmix.ListRowHighlighter):

    def __init__(self, parent):
        wx.ListCtrl.__init__(self, parent)
        listmix.ListRowHighlighter.__init__(self, (206, 218, 255))

See: http://www.wxpython.org/docs/api/wx.lib.mixins.listctrl.ListRowHighlighter-class.html

0

精彩评论

暂无评论...
验证码 换一张
取 消