wxPython: need return value from wxFrame

Mirko Koenig koenig at v-i-t.de
Tue Aug 26 14:00:27 EDT 2003


On Fri, 22 Aug 2003 22:56:36 +0200, Cliff Wells wrote:

> On Fri, 2003-08-22 at 12:27, Mirko Koenig wrote:
>> On Fri, 22 Aug 2003 00:28:23 +0200, Cliff Wells wrote:
>> 
>> > On Thu, 2003-08-21 at 15:17, Mirko Koenig wrote:
>> >> I can show() the frame from within the invoice code but show doesn't
>> >> return a value.
>> > 
>> > Use a wxDialog instead.
>> > 
>> > 
>> But how to return a list or tuple. All i can see is that a dialog
>> returns a int value
> 
> Try something like this:
> ....
> 
> 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.

I can't place a wxFrame in a sizer of a dialog. That would solve my
problem.

Are there any other ideas?

Mirko Koenig




More information about the Python-list mailing list