PySimpleApp Exit

Good day,

I am learning wxPython from wxPython in action by R.Dunn.

There is used code like this:

import wx

if name == “main”:
app = wx.PySimpleApp()
dialog = wx.Dialog(None, -1, “Test dialog”)
dialog.ShowModal()
dialog.Destroy()

I am little confused about this code, so there are questions:

Is app instance exited after dialog is Destroyed?
Does dialog belongs to app?
How does app knows that dialog belongs to it?

Thanks,

Aigars

The App object initializes the toolkit.
Some of it's functionality cannot be used without an app object being created.

Now to your questions:
1. yes, the script ends after the dialog is destroyed.
2. yes, the dialog becomes the application's TopWindow. Try print
app.GetTopWindow() after you create the dialog.
3. upon creation of the Dialog, wx adds it to the application.

Have you programmed in an Event Driven Environment before? Do you have
any GUI code experience?

Peter

···

On Sat, Sep 6, 2008 at 1:00 PM, Aigars Aigars <srad@inbox.lv> wrote:

Good day,

I am learning wxPython from wxPython in action by R.Dunn.

There is used code like this:

import wx

if __name__ == "__main__":
     app = wx.PySimpleApp()
     dialog = wx.Dialog(None, -1, "Test dialog")
     dialog.ShowModal()
     dialog.Destroy()

I am little confused about this code, so there are questions:

Is app instance exited after dialog is Destroyed?
Does dialog belongs to app?
How does app knows that dialog belongs to it?

Thanks,

Aigars
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

--
There is NO FATE, we are the creators.

Thank you for your answers.

Have you programmed in an Event Driven Environment before? Do you have
any GUI code experience?

No only MS Access experience. Want to migrate to Python + MySQL.

Have read “Learning Python” by Mark Lutz, now reading Python In Action By N.Rappin and R.Dunn. Maybe you could advice something for futher reading?

Aigars

Quoting Peter Damoc pdamoc@gmail.com:

···

The App object initializes the toolkit.
Some of it’s functionality cannot be used without an app object being created.

Now to your questions:

  1. yes, the script ends after the dialog is destroyed.
  2. yes, the dialog becomes the application’s TopWindow. Try print
    app.GetTopWindow() after you create the dialog.
  3. upon creation of the Dialog, wx adds it to the application.

Have you programmed in an Event Driven Environment before? Do you have
any GUI code experience?

Peter

On Sat, Sep 6, 2008 at 1:00 PM, Aigars Aigars <srad@inbox.lv> wrote:
> Good day,
>
> I am learning wxPython from wxPython in action by R.Dunn.
>
> There is used code like this:
>
> import wx
>
> if name == "main":
> app = wx.PySimpleApp()
> dialog = wx.Dialog(None, -1, "Test dialog")
> dialog.ShowModal()
> dialog.Destroy()
>
>
> I am little confused about this code, so there are questions:
>
> Is app instance exited after dialog is Destroyed?
> Does dialog belongs to app?
> How does app knows that dialog belongs to it?
>
>
>
> Thanks,
>
> Aigars
> _______________________________________________
> wxpython-users mailing list
> wxpython-users@lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
>


There is NO FATE, we are the creators.


wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi Aigars,

WxPython in Action is very well written. You should be able to do
fairly complex GUI stuff after you finish it.
Download and look at The Demo. It has tons of live code and a lot of
beginners used it extensively to learn about wxPython.
I still use it to get inspiration for the widgets I haven't used yet.

If you haven't discovered it yet, I would also recommend the wiki:
http://wiki.wxpython.org/How%20to%20Learn%20wxPython

Learn about code structuring and isolation. GUI code tends to evolve
into complex spaghetti code and if you do not manage it properly, you
will have very hard time maintaining it.
Read about:
http://wiki.wxpython.org/ModelViewController
and
http://wiki.wxpython.org/ModelViewPresenter

Since you are coming from Access, maybe you could also take a look at
Dabo (a framework designed to ease working with the databases)
http://dabodev.com/wiki/FrontPage

Peter

···

On Sat, Sep 6, 2008 at 3:36 PM, Aigars Aigars <srad@inbox.lv> wrote:

Thank you for your answers.

Have you programmed in an Event Driven Environment before? Do you have

any GUI code experience?

No only MS Access experience. Want to migrate to Python + MySQL.

Have read "Learning Python" by Mark Lutz, now reading Python In Action By
N.Rappin and R.Dunn. Maybe you could advice something for futher reading?

Aigars

Quoting Peter Damoc <pdamoc@gmail.com>:

The App object initializes the toolkit.
Some of it's functionality cannot be used without an app object being
created.

Now to your questions:
1. yes, the script ends after the dialog is destroyed.
2. yes, the dialog becomes the application's TopWindow. Try print
app.GetTopWindow() after you create the dialog.
3. upon creation of the Dialog, wx adds it to the application.

Have you programmed in an Event Driven Environment before? Do you have
any GUI code experience?

Peter

On Sat, Sep 6, 2008 at 1:00 PM, Aigars Aigars &lt;srad@inbox.lv&gt; wrote:
&gt; Good day,
&gt;
&gt; I am learning wxPython from wxPython in action by R.Dunn.
&gt;
&gt; There is used code like this:
&gt;
&gt; import wx
&gt;
&gt; if __name__ == &quot;__main__&quot;:
&gt; app = wx.PySimpleApp()
&gt; dialog = wx.Dialog(None, -1, &quot;Test dialog&quot;)
&gt; dialog.ShowModal()
&gt; dialog.Destroy()
&gt;
&gt;
&gt; I am little confused about this code, so there are questions:
&gt;
&gt; Is app instance exited after dialog is Destroyed?
&gt; Does dialog belongs to app?
&gt; How does app knows that dialog belongs to it?
&gt;
&gt;
&gt;
&gt; Thanks,
&gt;
&gt; Aigars
&gt; _______________________________________________
&gt; wxpython-users mailing list
&gt; wxpython-users@lists.wxwidgets.org
&gt; http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
&gt;
&gt;

--
There is NO FATE, we are the creators.
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

--
There is NO FATE, we are the creators.

You took the words right out of my mouth. Aigars, I strongly agree with Peter
check out Dabo. Dabo was designed with you in mind. It has very strong GUI
and data integration making it ideal for a access person.

···

On Saturday 06 September 2008 06:01:27 am Peter Damoc wrote:

Hi Aigars,

WxPython in Action is very well written. You should be able to do
fairly complex GUI stuff after you finish it.
Download and look at The Demo. It has tons of live code and a lot of
beginners used it extensively to learn about wxPython.
I still use it to get inspiration for the widgets I haven't used yet.

If you haven't discovered it yet, I would also recommend the wiki:
How to Learn wxPython - wxPyWiki

Learn about code structuring and isolation. GUI code tends to evolve
into complex spaghetti code and if you do not manage it properly, you
will have very hard time maintaining it.
Read about:
ModelViewController - wxPyWiki
and
ModelViewPresenter - wxPyWiki

Since you are coming from Access, maybe you could also take a look at
Dabo (a framework designed to ease working with the databases)
http://dabodev.com/wiki/FrontPage

Peter

--
John Fabiani

The idea is good, but I couldn’t find a working URL to download the Windows installer for Dabo Running Engine. Anybody is willing to help?

···

2008/9/6 johnf jfabiani@yolo.com

On Saturday 06 September 2008 06:01:27 am Peter Damoc wrote:

Hi Aigars,

WxPython in Action is very well written. You should be able to do

fairly complex GUI stuff after you finish it.

Download and look at The Demo. It has tons of live code and a lot of

beginners used it extensively to learn about wxPython.

I still use it to get inspiration for the widgets I haven’t used yet.

If you haven’t discovered it yet, I would also recommend the wiki:

http://wiki.wxpython.org/How%20to%20Learn%20wxPython

Learn about code structuring and isolation. GUI code tends to evolve

into complex spaghetti code and if you do not manage it properly, you

will have very hard time maintaining it.

Read about:

http://wiki.wxpython.org/ModelViewController

and

http://wiki.wxpython.org/ModelViewPresenter

Since you are coming from Access, maybe you could also take a look at

Dabo (a framework designed to ease working with the databases)

http://dabodev.com/wiki/FrontPage

Peter

You took the words right out of my mouth. Aigars, I strongly agree with Peter

check out Dabo. Dabo was designed with you in mind. It has very strong GUI

and data integration making it ideal for a access person.

John Fabiani


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

I believe the current Dabo Running Engine is far behind the current SVN. So I
suggest you use the svn. Just check the site for install instructions and
how to setup SVN on windows along with setup for DAbo.

···

On Saturday 06 September 2008 09:09:01 am raffaello wrote:

The idea is good, but I couldn't find a working URL to download the Windows
installer for Dabo Running Engine. Anybody is willing to help?

--
John Fabiani