What is the relationship between app and frame? I don't see any
relationship between them in the above code.
The frame is the thing you see onthe screen. The app provides system
initialization, the message retrieval and event dispatching loop. Without
the app the frame would get no events.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
> from wxPython.wx import wxPySimpleApp, wxFrame
> app = wxPySimpleApp()
> frame = wxFrame(None, -1, "Hello World")
> frame.Show(1)
> app.MainLoop()
>
> What is the relationship between app and frame? I don't see any
> relationship between them in the above code.
The frame is the thing you see onthe screen. The app provides system
initialization, the message retrieval and event dispatching loop. Without
the app the frame would get no events.
Also, when you pass None in as the parent of wxFrame (the first
argument), you are telling it that it is a top level frame, and therefor
the primary frame of the app.
Also, when you pass None in as the parent of wxFrame (the first
argument), you are telling it that it is a top level frame, and therefor
the primary frame of the app.
Not quite true. Any frame/dialog with None for parent is a top level frame,
and an app can have more than one, so there really isn't a concept of a
primary frame anymore.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!