Is there a way to change tkcalendar's color? Is there a way to change tkcalendar's color? tkinter tkinter

Is there a way to change tkcalendar's color?


You are doing it the right way, except that OSX default theme does not support changing background colors (it is based on pictures I think so you can only change the text color).The solution is to use a different ttk theme (e.g. clam or alt):

import tkinterfrom tkinter import ttkfrom tkcalendar import Calendarwindow = tkinter.Tk()window.configure(background = "black")style = ttk.Style(window)style.theme_use('clam')   # change theme, you can use style.theme_names() to list themescal = Calendar(window, background="black", disabledbackground="black", bordercolor="black",                headersbackground="black", normalbackground="black", foreground='white',                normalforeground='white', headersforeground='white')cal.config(background = "black")cal.pack()

By the way, the option 'borderbackground' does not exists, the correct name is 'bordercolor'.

screenshot


The Calendar class in tkcalendar module is a subclass of ttk.Frame.

class Calendar(ttk.Frame):

You must use the styling specific to ttk that uses themes to alter its attributes.