Can tkinter create custom buttons from an image or icon like this?
It's possible!
If you check out the button documentation, you can use an image to display on the button.
For example:
from tkinter import * root = Tk() button = Button(root, text="Click me!") img = PhotoImage(file="C:/path to image/example.gif") # make sure to add "/" not "\" button.config(image=img) button.pack() # Displaying the button root.mainloop()
This is a simplified example for adding an image to a button widget, you can make many more cool things with the button widget.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With