wxPython: need return value from wxFrame

Mirko Koenig koenig at v-i-t.de
Wed Aug 27 12:46:16 EDT 2003


Hi

On Tue, 26 Aug 2003 23:02:23 +0200, Cliff Wells wrote:

> 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.

OK. I try again to explain:
I have two stand-alone apps: 
1) customer addressbook
2) invoice

Both made with wxpython.
Both contain:
class cabGui( wxApp ):
    def OnInit( self ):
        self.frame = cabMainFrame( NULL )
        self.frame.Show()
        self.SetTopWindow( self.frame )

        return true
...
if __name__ == '__main__':
    app = cabGui(0)
    b = app.MainLoop()

In the customer addressbook the cabMainFrame is the addressbook frame.
In the invoice app the cabMainFrame is the frame containing invoice
specific buttons/field etc.

The cabMainFrame is a wxFrame derivered class. it contains other frames
and a status bar and so on.

What i want is to call the customeraddressbook from within the invoice
app. To give the user the chance to select an address from the
addressbook. That address should then be inserted into the invoice Gui.

I thought this is perhaps possible, so i don't have to write the
addressbokk code twice. I thought i can just use the addressbook and give
back the selected address. So that i can use it in the invoice Gui.

The only solution i found until now is to set an variable in the
customer addressbook that points to one from the invoice Gui if i want to
set it. If not it points to None.

customerFrame.setAddrVar( invoiceAddr )
customerFrame.Show()


Mirko Koenig




More information about the Python-list mailing list