Search code examples
python-3.xuser-interfacetkintercalendar

Calendar size too small in Tkcalendar


I am making an attendance system in Tkinter. And I came across Tkcalendar but the calendar size seems small. Is there any way to increase the size of the calendar? Or do I have to make a custom calendar? Any help will be appreciated.

Calendar


Solution

  • See here: https://tkcalendar.readthedocs.io/en/stable/example.html for code examples demonstrating the calendar. Here the first one:

    from tkinter import Tk
    from tkcalendar import Calendar
    root = Tk()
    root.geometry('920x640')
    cal = Calendar(root, font="Arial 14", selectmode='day', locale='en_US',
                   cursor="hand1", year=2021, month=6, day=19)
    cal.pack(fill="both", expand=True)
    root.mainloop()
    

    If 920x640 is still to small change it to 1024x768 or 1280x920 . Anyway, the calendar has not a fixed size and resizes to the chosen window size. If you need larger numbers, increase the font size to e.g. 24 in Calendar(root, font="Arial 24". No need to write an own version or patch the module.