I'm trying to create a Tkinter app using classes but I'm running into an issue being able to change the button state to disabled after clicking the button. The error I'm currently getting is: AttributeError: 'Menu' object has no attribute 'menu_button'
I'm new to Tkinter, though I think I'm failing more on my understanding of classes. So if in addition to helping me to get my code to work if there are some additional resources you recommend to strengthen my understanding I'd appreciate it.
Here is my current code:
import tkinter as tk
from tkinter import ttk
class App(tk.Tk):
def __init__(self):
super().__init__()
self.geometry("425x350")
self.title("Poly Calculator")
self.menu = Menu(self)
self.mainloop()
class Menu(ttk.Frame):
def __init__(self, parent):
super().__init__(parent)
self.place(x=0, y=0)
menu_button = ttk.Button(self, text = 'Button 1', command=self.change_state)
menu_button.pack()
def change_state(self):
self.menu_button['state'] = 'disabled'
App()