wxPython: need return value from wxFrame

Cliff Wells logiplex at qwest.net
Tue Aug 26 23:02:23 CEST 2003


On Tue, 2003-08-26 at 11:00, Mirko Koenig wrote:
> On Fri, 22 Aug 2003 22:56:36 +0200, Cliff Wells wrote:
> > 
> > app = wx.PySimpleApp()
> > dlg = MyDialog(None, -1)
> > retval = dlg.ShowModal()
> > if retval == wx.ID_OK:
> >     print dlg.GetValue()
> > dlg.Destroy()
> > app.MainLoop()
> > 
> 
> I tried but couldn't find a solution.
> As i said before, i have a wxframe derivered class for my addressbook to
> have a stand-alone addressbook. Stand-alone in my case means that it is a
> app for itself. Not only a extra windows in the invoice application.
> 
> It contains wxFrame specific things like status bar etc.
> Therefore i could not deriver it from wxDialog.

That isn't a problem in and of itself.  The code above could be used
with a wxFrame instead (with minor modifications).

> I can't place a wxFrame in a sizer of a dialog. That would solve my
> problem.
> 
> Are there any other ideas?

Maybe a better idea of exactly what you want would help.  Your app has
only a single wxFrame?  You want that frame to return something?  To
what?  I would think when the frame "returns" the app would exit if it's
the only frame.

Regards,

-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726  (800) 735-0555






More information about the Python-list mailing list