I am creating a shift table by tkcalendar.
I would like to make the selected dates show their own timetable, as illustrated in the picture.
Is it possible to achieve this by any methods provided by tkcalendar? Or the only way I can do this is created a custom calendar from zero? I went through the document, but hardly finding something useful.
NOTE: I don't want tooltip(pop-up text)
It is not possible from tkcalendar's methods to display text below the day number in the Calendar. However, you don't have to start from scratch, you can create an
Agenda
class inheriting fromCalendar
and only rewrite the methods displaying the events to put them inside the day's label instead of in a popup.To be precise, 3 methods need to be modified:
_display_days_without_othermonthdays()
,_display_days_with_othermonthdays()
and_show_event()
, see code below. The code might seem long but I actually only modified a couple of lines in each methods compared to there original version in tkcalendar.