我需要将一个变量从一个类发送到另一个类
我的代码:
我得到的类是可变的
class Application(tk.Tk):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
#TOOLBAR MENU
toolbar = tk.Frame(self, bd = 1, relief = tk.RAISED)
self.choicebutton = tk.Button(toolbar, command=self.choice)
#TOOLBAR MENU
toolbar = tk.Frame(self, bd = 1, relief = tk.RAISED)
I类导入变量:
class Frame1(tk.Frame):
def __init__(self, parent, *args, **kwargs):
super().__init__(parent, *args, **kwargs)
a.Application.choicebutton.config(state="disabled")
我得到一个错误:
AttributeError: type object 'Application' has no attribute 'choicebutton'
假设
parent
是Application
对象:将最后一行更改为
相关问题 更多 >
编程相关推荐