TomSchimansky / CustomTkinter

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

How can I enable transparency for the border_color attribute in the CTkButton class? #1828

Open elly-hacen opened 1 year ago

elly-hacen commented 1 year ago

Image with corner radius:

image

I'm using the CTkButton class from the customtkinter library, and I would like to make the button's border color transparent. However, when I set the border_color attribute to "transparent", I encounter a ValueError stating that transparency is not allowed for this attribute.

I would like to know if there is a way to enable transparency for the border_color attribute in the CTkButton class. If there is no built-in support for transparency, I would appreciate guidance on modifying the CTkButton class to allow transparency for the border color.

Any help or insights would be greatly appreciated. Thank you!

ghost commented 1 year ago

Next time, please ask questions in the Q&A section of the Discussions tab. If you find out this isn't possible through customtkinter and you want the feature (or you find a bug), then open an issue.

ghost commented 1 year ago

One work around would be to set the border color to the background color. This isn't ideal due to theme changes and light/dark mode.

Furthermore, I'd suggest changing the title to say "Add transparency for border color attribute" or something like that. The new title makes your issue a feature request/enhancement rather than a question.

elly-hacen commented 1 year ago

Apologies for any inconvenience caused. I am currently learning GitHub and custom tkinter, and my knowledge in these areas is limited at the moment. I will become proficient in these tools in the future. Thank you for your understanding and support.

ghost commented 1 year ago

No problem, in this case the issue is fine as you'd basically be asking for transparency to be added as a border color option. I'd suggest changing the title to make this more clear.

Akascape commented 9 months ago

@elly-hacen A new solution: https://github.com/TomSchimansky/CustomTkinter/discussions/2214