📜  如何制作自定义按钮 tkinter - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:08.588000             🧑  作者: Mango

代码示例1
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()