且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

wxPython UltimateListCtrl以编程方式检查(勾号)listitem

更新时间:2023-02-07 09:01:42

您需要从列表中获取项目,选中它,然后将其保存回列表中:

You need to get the item from the list, check it and then save it back into the list:

def checkItems(self):
    idx = [1, 3, 6, 7, 9, 11, 15, 17, 20]
    for i in idx:
        temp = self.list.GetItem(i, 0)
        temp.Check(True)
        self.list.SetItem(temp)