As the title says, I would appreciate some help recolouring the titlebar on a CustomTkinter window in python. I would much prefer to not replace the original object and use a canvas and buttons to rebuild it as it loses some core functionality and doesn't look as good in my opinion. I have also already tried using the 'ctypes' module as an alternative, as recommended by stack overflow, however it does not appear to change anything. All help is appreciated!
#Recolouring the title bar on a CTk (CustomTkinter) window
7 messages · Page 1 of 1 (latest)
if u really mean the titel bar from the window, you cant change the look of it. its os build.
You can work around with removing it and building the functionality yourself
but maybe resize & drag functionality get lost
I hopede there would be a solution given that the title bar already differs between light and dark mode, anyway, thanks for letting me know so I didn't just sit there struggling for a few more hours haha
just took me 2 mins googeling to be honesr ;D
I spent hours trying to find anything I could, might have no choice though:(
You can only create your own titlebar while disabling the OS specific title bar.
So you can make it work, but takes a lot of extra steps to make it work like normal windows bar(and dont forget the names are still saved inside the hidden title bar)
I have found the solution! I found the "py-window-styles" module on github, the command to change the style is easy too! to install it just simply type "pip install pywinstyles" in your terminal.
here's an example usage:
import pywinstyles
import customtkinter as ctk
root = ctk.CTk()
pywinstyles.change_header_color(root, color="#00524d")
root.mainloop()