On 11/30/10 8:36 AM, Iain Simpson wrote:
> created a new new 'main.py' which is the imdata program with the
> myForm = ... line added
>
>    #!/usr/bin/env python
>    # -*- coding: utf-8 -*-
>
>    import dabo
>    dabo.ui.loadUI("wx")
>    app = dabo.dApp()
>    app.MainFormClass = "imdata.cdxml"
>
>    myForm = dabo.ui.createForm("ui/imapim.cdxml")
>
>    app.start()
>
> If I run this I get an error :
>
> wx._core.PyNoAppError: The wx.App object must be created first!

Put app.setup() somewhere after app=dabo.dApp() but before the createForm call.

> I don't really know where to start looking. Is there a thread in the
> archives (or other document/screencast that I should be consulting ?

No, you are consulting the correct place.

> Sorry if this is elementary stuff but I want to make this work.

No need to be sorry.

There's really a 3-stage dApp instantiation process:

1) create the app:
app = dabo.dApp()

2) set up the app:
app.setup()

3) start the app event loop:
app.start()

The setup() call is where the UI library's app object (wx.App) gets hooked into 
Dabo's (dabo.dApp). Before setup() is called, there's no wx.App instantiated, 
hence 
the error you got.

There are other ways to implicitly get dApp.setup() to run, but I think it is 
clearer 
to just remember the 3 steps above.

Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to