【发布时间】:2020-01-23 04:56:54
【问题描述】:
我有一个类 GUI 创建一个带有几个小部件的 tk 窗口 我希望保存按钮的状态根据一些自我的值而改变
在def init里面:
btn_save['state']='disabled'
if self.basepath and (self.variable.get() == 0 or self.variable.get() =='1) and (self.secondOpt.get() == '0 or self.secondOpt.get() == 1):
btn_save['state']='normal' #here I want to change the save button state
主程序:
window = Tk()
my_gui = GUI(window)
window.mainloop()
我该怎么做?
【问题讨论】:
标签: python user-interface button tkinter state