TomSchimansky / CustomTkinter

A modern and customizable python UI-library based on Tkinter
MIT License
11.55k stars 1.08k forks source link

KeyError (Note that I am using a custom theme for dark purple-blue) #2062

Open MoYusr opened 1 year ago

MoYusr commented 1 year ago

File "D:\Folders\Programming\Python Projects\UI-based\Task Manager\main.py", line 49, in checkbox = ck.CTkCheckBox(entry_tab, text="Insert Mode", variable=insert_mode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ADMIN\AppData\Roaming\Python\Python311\site-packages\customtkinter\windows\widgets\ctk_checkbox.py", line 54, in init self._fg_color = ThemeManager.theme["CTkCheckbox"]["fg_color"] if fg_color is None else self._check_color_type(fg_color)


KeyError: 'CTkCheckbox'

Customtkinter setup:
![image](https://github.com/TomSchimansky/CustomTkinter/assets/63252676/da336ba2-4b83-4a25-8c17-237acb607fa0)

JSON file checkbox part:
![image](https://github.com/TomSchimansky/CustomTkinter/assets/63252676/0220881b-4ee2-4428-94dd-86547a9856f1)

and yes the path is correct it worked for other objects like buttons and labels
Akascape commented 1 year ago

@MoYusr Check the spellings properly, the b in box is in upper case.

Your Code:

ThemeManager.theme["CTkCheckbox"]

Correction:

ThemeManager.theme["CTkCheckBox"]

Close the issue if fixed.