[wxPython] Get all windows of an application?

Hello everybody,

another stupid wxPython question on my part.
It looks like I do have a wxFrame member variable which I can set
"otherWin". It is used in the demo but not documented otherwise.

Mainly I am interested in how to get all windows of one application.
It seems to be okay to just add windows without parent within an
application and they all will be treated equally by the main loop.
So how do I get a hold of them?

Concluding from hints in the documentation I should use a main frame
and several subframes which do use this main frame as a parent.
Then I should be able to get the Children with the GetChildren
or so method. Is this correct?

How can I get the parent of a windows/frame?

Somewere in the docs I recall that a child window will always be
displayed on top of the parent windows under Windows(?). If this is
true how do I create windows which are treated equally?

Sorry for being so vaque,
  Bernhard

ps.: PLease cc relevant replies as I am not on the list.

···

--
Professional Service around Free Software (intevation.net)
The FreeGIS Project (freegis.org)
Association for a Free Informational Infrastructure (ffii.org)
FSF Europe (fsfeurope.org)

another stupid wxPython question on my part.
It looks like I do have a wxFrame member variable which I can set
"otherWin". It is used in the demo but not documented otherwise.

That only exists and is used in the demo.

Mainly I am interested in how to get all windows of one application.
It seems to be okay to just add windows without parent within an
application and they all will be treated equally by the main loop.
So how do I get a hold of them?

Everytime you create a frame, append it to a list. When a frame is closed it can remove itself from this list.

Concluding from hints in the documentation I should use a main frame
and several subframes which do use this main frame as a parent.
Then I should be able to get the Children with the GetChildren
or so method. Is this correct?

Yes, but it will also get non-frame children as well.

How can I get the parent of a windows/frame?

frame.GetParent()

Somewere in the docs I recall that a child window will always be
displayed on top of the parent windows under Windows(?). If this is
true how do I create windows which are treated equally?

As you said above, create the frame with no parent.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

> > another stupid wxPython question on my part.
> > It looks like I do have a wxFrame member variable which I can set
> > "otherWin". It is used in the demo but not documented otherwise.
>
> That only exists and is used in the demo.

This is strange, because I used it in a different application
I was adding to and it did exist as a member.

In Python, unless you take action to prevent it, "anyObj.attr = something" will create an attribute in the object. It doesn't mean that the object or the rest of the system knows anything about it.

> > Mainly I am interested in how to get all windows of one application.
> > It seems to be okay to just add windows without parent within an
> > application and they all will be treated equally by the main loop.
> > So how do I get a hold of them?
>
> Everytime you create a frame, append it to a list. When a frame is
closed it can remove itself from this list.

Well wouldn't it make sense to keep this list automatically by
wxWindows?

It does, but there is currently no access to it in wxPython. Probably should be though. (Yet another item goes onto the ToDo list...)

> > Concluding from hints in the documentation I should use a main frame
> > and several subframes which do use this main frame as a parent.
> > Then I should be able to get the Children with the GetChildren
> > or so method. Is this correct?
>
> Yes, but it will also get non-frame children as well.

Okay, but I could decide between them, right?

Currently all you will get is a list of wxWindow objects. You won't be able to tell them apart. (I've got a fix partially implemented for this BTW.)

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

> > > another stupid wxPython question on my part.
> > > It looks like I do have a wxFrame member variable which I can set
> > > "otherWin". It is used in the demo but not documented otherwise.
> >
> > That only exists and is used in the demo.
>
> This is strange, because I used it in a different application
> I was adding to and it did exist as a member.

In Python, unless you take action to prevent it, "anyObj.attr =
something" will create an attribute in the object. It doesn't
mean that the object or the rest of the system knows anything
about it.

Well, of course. *dang*
I was put off because the window appeared. How humiliating...

> Okay, but I could decide between them, right?

Currently all you will get is a list of wxWindow objects. You
won't be able to tell them apart. (I've got a fix partially
implemented for this BTW.)

Okay, thanks.
  Bernhard

···

On Tue, Feb 06, 2001 at 10:52:10AM -0800, Robin Dunn wrote:

--
Professional Service around Free Software (intevation.net)
The FreeGIS Project (freegis.org)
Association for a Free Informational Infrastructure (ffii.org)
FSF Europe (fsfeurope.org)