Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想更改此日历中特定单元格的背景
cal = Calendar(root,selectmode="day",year=2020,month=7,day=10)
在 Tkinter。但我不知道该怎么做,请帮助我。
您可以使用标签将标签附加到特定日期calevent_create(),然后使用tag_config()标签更改背景颜色:
calevent_create()
tag_config()
下面是一个例子:
import datetime ... day = datetime.date(2020, 7, 20) cal.calevent_create(day, "", tags="hi") cal.tag_config("hi", background="red")