[wxPython] keeping track of multiple windows?

ok, here's a minimal example that exhibits this behavior. my problem seems to be in MainLoop, but i don't know why. i do need to split open main loop because that mainloop needs to deal with both window events and chat events.
-z
--START--
from wxPython.wx import *
class MyApp(wxApp):
    def OnInit(self):
        self.main=MainFrame(self)
        self.main.Show(true)
        self.SetTopWindow(self.main)
        self.close=0
        self.online=1
        self.main.GetFrame("1").Show(true)
        self.main.GetFrame("2").Show(true)
        return true
    def MainLoop(self):
        while not(self.close):
            if self.Pending():self.Dispatch()
            # handle chat event here
class MainFrame(wxFrame):
    def __init__(self,parent):
        wxFrame.__init__(self,NULL,-1,"main",wxDefaultPosition,wxDefaultSize)
        self.parent=parent
        self.frames={}
        EVT_CLOSE(self,self.OnCloseWindow)
    def OnCloseWindow(self,event):
        self.Destroy()
        self.parent.close=1
    def GetFrame(self,name):
        if name not in self.frames.keys(): # don't already have a frame
            self.frames[name]=MessageFrame(self,name)
        return self.frames[name]
    def CloseFrame(self,name):
        del self.frames[name] # need to know when the frame isn't there anymore
class MessageFrame(wxFrame):
    def __init__(self,parent,name):
        self.parent=parent
        self.name=name
        wxFrame.__init__(self,parent,-1,name,wxDefaultPosition,wxDefaultSize)
        EVT_CLOSE(self,self.OnCloseWindow)
    def __del__(self):
        print "__del__"
    def OnCloseWindow(self,event):
        print "closing"
        self.Show(false)
        self.parent.CloseFrame(self.name) # remove ourselves from the list
        self.Destroy()
        print "closed"
a=MyApp(0)
a.MainLoop()
--END--

···

---------------------
(o_ z3p@z3p.org
//\ www.z3p.org
V_/_

It is true that liberty is precious, but is it so precious it must be rationed?
-----Original Message-----
From: z3p <z3p@mailandnews.com>
To: wxpython-users@lists.sourceforge.net <wxpython-users@lists.sourceforge.net>
Date: Wednesday, December 20, 2000 4:26 PM
Subject: Re: [wxPython] keeping track of multiple windows?

now it's getting strange. my minimal example does not exhibit the same problem. after some further examination, it appears that the window is not being destructed. is there anyway to find the places where this window is referenced?
-z
---------------------
(o_ z3p@z3p.org
//\ www.z3p.org
V_/_

It is true that liberty is precious, but is it so precious it must be rationed?
-----Original Message-----
From: Robin Dunn <robin@alldunn.com>
To: wxpython-users@lists.sourceforge.net <wxpython-users@lists.sourceforge.net>
Date: Wednesday, December 20, 2000 1:51 PM
Subject: Re: [wxPython] keeping track of multiple windows?

What do you mean by "come up and lock when
the program is minimized" ?

if you open _any_ child windows with this, when you minimize the main

frame, all of >the frames you have ever opened come back up, and they cannot
be closed (clicking >the X doesn't work, neither does alt-f4) without
restarting the main program.

Can you create a minimal sample that reproduces this? I'm real curious what
could be causing it.

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

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

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

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