intro_screen
is an attribute of MainFrame
instances; not of MainMenu
instances.
Your MainMenu.__init__()
method is passed in a MainFrame
instance as parent
. I am not certain if self.parent
is set by the line wx.Frame.__init__(self, parent=parent)
, but if it is not, do add self.parent = parent
in MainMenu.__init__(
.
You can then refer to self.parent
on MainMenu
instances, and the following should work:
self.parent.intro_screen.Show()
I am not sure why you are setting the current class as an instance attribute:
self.main_menu = MainMenu
and
self.intro_screen = IntroScreen
Instead of self.main_menu.Hide(self)
you can just call self.Hide()
, the reference to the class is not needed.