Skip to content

CTk (tkinter.Tk)

TomSchimansky edited this page Mar 3, 2022 · 18 revisions

ou can use the normal tkinter.Tk class to create the root window, but if you want a background color that changes with the appearance mode and a dark title-bar on macOS, you should use the customtkinter.CTk class which behaves exactly like the normal Tk class, except that you can also set a tuple color as bg color.

Example Code:

root_tk = customtkinter.CTk()

... program ...

root_tk.mainloop()

All Arguments

argument value
bg_color or bg tuple: (light_color, dark_color) or single color

Methods:

root_tk = customtkinter.CTk()
# configure bg color with single or tuple color
root_tk.configure(bg_color="gray20")
root_tk.configure(bg_color=(<light-mode color>, <dark-mode color>))

⚠️ Attention ⚠️

The Github Wiki is outdated, the new documentation can be found at:

https://customtkinter.tomschimansky.com

Clone this wiki locally