dark_mode.py 文件源码

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

项目:wxpythoncookbookcode 作者: driscollis 项目源码 文件源码
def darkRowFormatter(listctrl, dark=False):
    """
    Toggles the rows in a ListCtrl or ObjectListView widget. 
    """

    listItems = [listctrl.GetItem(i) for i 
                 in range(listctrl.GetItemCount())]
    for index, item in enumerate(listItems):
        if dark:
            if index % 2:
                item.SetBackgroundColour("Dark Grey")
            else:
                item.SetBackgroundColour("Light Grey")
        else:
            if index % 2:
                item.SetBackgroundColour("Light Blue")
            else:
                item.SetBackgroundColour("Yellow")
        listctrl.SetItem(item)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号