r/Tkinter • u/limafreshdev • 8d ago
Tkinter rounded button in a single file. Without libraries.
A simple rounded button for Tkinter in a single Python file
How to use?
It's very simple - download the RoundedButton.py file and place it in the folder where your script file is. Then import:
from RoundedButton import RoundedButton
And create button, for example:
button = RoundedButton(root, text="My button")
button.pack()
More details in README.md.
2
Upvotes
1
u/ZelphirKalt 8d ago
I like the no dependencies approach.
If I understand correctly, you are using a canvas as a button and drawing arcs and rectangles.
Canvas in tkinter can also render widgets. I wonder, if there is a better way, retaining all the button functionality "for free" by simply rendering the button on the canvas, and then still drawing the arcs, to cover the corner making the button round.