1

I need to change the color of the Tkinter window border-color in windows 10 python. The border is shown in the image below.

enter image description here

I found a command that can delete the border

root.overrideredirect(1)

when I use this command I need to rebuild the border again but the functionality is different. So it's not an option. Is there any way I could change the Tkinter window border color? I only need to change the color of the border. Rebuilding the border is too much and some of the functionalities won't work properly.

Sumeth Sathnindu
  • 323
  • 4
  • 15
  • Does this answer your question? [Can I change the title bar in Tkinter?](https://stackoverflow.com/questions/23836000/can-i-change-the-title-bar-in-tkinter) – Axisnix Mar 03 '21 at 12:46
  • @FluxedScript Yes, your suggestion works too but I only need to change the border-color and when rebuilding the border some functionalities are not working properly and it's too much. Thanks for your answer it is very helpful. I'll try to use it if I can. Thanks again. – Sumeth Sathnindu Mar 03 '21 at 13:01
  • @SumethSathnindu-Lucifer You can not change the color of the title bar since it is something added by the OS, `tkinter` has no idea about it. You will have to rebuild it. – astqx Mar 03 '21 at 13:06
  • @AST It seems I have to rebuild the border from the scratch. Thank you for your answers. – Sumeth Sathnindu Mar 03 '21 at 13:21

1 Answers1

0

Sorry you cannot change the color of the border as it is created by the OS and it changes device-to-device. But you can use overrideredirect(1) to cancel the border. And to exit the window, you can use the destroy() command.