Tkinter 无法更改列表框中的多项选择

问题描述

我正在尝试创建一个可以跟踪时间的“待办事项”应用程序。如果任务在某个日期之前没有完成,那么任务会改变颜色。问题是我似乎无法选择多个任务并更改它们的颜色 最后的打印语句只是为了检查函数是否有效

代码=

list1=tkinter.listBox

what_to_color = []

def check_date():
    for i in list1.get(0,tkinter.END):
        current_day = datetime.date.today()
        days_to_pass = 1
        end_time = datetime.timedelta(days=days_to_pass)
        end_date = current_day + end_time
        root.after(555,check_date)

        if end_date == current_day + datetime.timedelta(days=1) and i not in what_to_color:
            what_to_color.append(i)
        print('needs to color')

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)