[wxpython-users] Re: [newbie] Connection between app and frame?

Gilles gilles.ganault at free.fr
Thu Apr 3 10:28:54 PDT 2008


On Thu, 03 Apr 2008 10:12:16 -0700, Christopher Barker
<Chris.Barker at noaa.gov> wrote:
>As you've seen from the messages here, there are lots of ways, but my 
>earlier suggestion:

Sorry, I wasn't clear: I don't want to link the two. I'd like to
understand how the two know about each other, since I don't see any
instruction that somehow links the app and the frame, hence how does
the app know that the frame was closed, and it should terminate the
application?

>The demo code form the book you're looking at is simplified to the 
>easiest way to get an app up.

OK, so it doesn't really matter. The fuller code below does link the
two and makes sense to a newbie like me:

>class MyApp(wx.App):
>     def OnInit(self):
>         self.frame = MyFrame(None, -1)
>         self.SetTopWindow(self.frame)
>         self.frame.Show()
>         return True

Thanks guys.



More information about the wxpython-users mailing list