Is there a wxpython list widget that displays alternating row colours even when the list is empty?
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
精彩评论