我正在尝试使用 Tkinter 禁用按钮:
from Tkinter import *
import os
class OptionWindow:
def __init__(self, value):
self.master = Tk()
self.master.minsize(500,500)
self.b1 = Button(self.master, text = "save Game", command =self.saveGame, state = NORMAL).grid(row = 0, column = 1, sticky = W)
def saveGame(self):
from modules.startingKit import options
options.saved = True
self.b1.configure (state = DISABLED)
然而,由于某种原因,当我按下“保存游戏”按钮时,它的外观并没有改变。我必须做什么才能禁用它?