I'm simply trying to reference an inherited Tkinter screen in a subclass, but for some reason I receive this error:
AttributeError: 'SignUpScreen' object has no attribute '_SignUpScreen__window'
After I try to execute:
self.__signupScreen = SignUpScreen()
And the class code is:
from tkinter import *
class Screen:
def __init__(self, screenTitle, size):
self.__window = Tk()
self.__window.title(screenTitle)
self.__SIZE = size #W x H
def close(self):
#Save all data, then
self.__window.destroy()
class SignUpScreen(Screen):
def __init__(self):
super().__init__("Sign Up", "700x400")
self.__titlelbl = Label(self.__window, text="Sign Up Window", font=("Arial Bold", 22))
def run(self):
self.__titlelbl.grid(column=0, row=0)
self.__window.mainloop()
The IDE claims the error occurs at the following line:
self.__titlelbl = Label(self.__window, text="Sign Up Window", font=("Arial Bold", 22))
I do not understand what the issue is. Can anyone spot the issue?