如何让Tkinter GUI有一个显示为图片的按钮?

时间:2018-04-06 20:55:02

标签: python tkinter

如何使用显示为图片的按钮制作Tkinter GUI?

当前代码看起来有点像这样:

from tkinter import *

master = Tk()

def Cookie():
    global globcookies
    global CookieValue
    global globMultiply
    global globUser
    global globLoggedIn
    CookieValue = 1 * globMultiply
    globcookies = globcookies + CookieValue
    print("Cookies =",globcookies)
    Info()
    Line()
    if globLoggedIn == "true":
        SaveData()

Button(master, text='Click!', command=Cookie).grid(row=2, column=1, sticky=W, pady=4)

1 个答案:

答案 0 :(得分:0)

这是非常简单的,你会发现它有一些googeling:

!important