我得到这个回溯:
Traceback (most recent call last):
File "/home/amentis/Dropbox/Rexi/index.py", line 21, in application
ui = Console.Console()
File "/home/amentis/Dropbox/Rexi/UI/Console.py", line 9, in __init__
self.__window = Window.Window(self, 'consoleWindow')
File "/home/amentis/Dropbox/Rexi/RxAPI/RxGUI/Window.py", line 16, in __init__
self.__parent.add_child(self)
AttributeError: 'Window' object has no attribute '_Window__parent'
这是控制台类的一部分:
class Console(Screen.Screen):
def __init__(self):
super().__init__("REXI Console")
self.__window = Window.Window(self, 'consoleWindow')
窗口类:
class Window(RxGUIObject.RxGUIObject):
def __init__(self, parent, name):
RxGUIObject.RxGUIObject.__init__(self, name, parent)
self.__body = ""
self.__javascript = ""
self.__css = ""
self.__parent.add_child(self)
和 RxGUIObject:
class RxGUIObject(RxObject.RxObject):
def __init__(self, name, parent):
RxObject.RxObject.__init__(self, name)
self.__parent = parent
self.__children = list
是Window.__parent
没有被创造或不存在,为什么?