I'm trying to get the elements located in the init of my class from another method in order to update a label. Here is an example code:
class mainApp:
def __init__(self, master):
my_frame = tk.Frame(master)
my_frame.pack()
label = tk.Label(master, text="Press the button")
label.pack()
btn = tk.Button(master, text="press", command=ft.partial(self.pressed))
btn.pack()
def pressed(self)
self.label.text = "Pressed"
The error I get is the following:
AttributeError: 'mainApp' object has no attribute 'label'
Is there a way to access this widgets from the init method of the class?
Thanks!