[wxPython] Fw: Pythonwin and EVT_CLOSE crash

Hi,

I was using Pythonwin build 134. I have now changed it to build 135 and the
problem has gone away. It now runs without crashing.

Regards,

Gordon Williams

···

----- Original Message -----
From: "Gordon Williams" <g_will@cyberus.ca>
To: "wxPython List" <wxpython-users@lists.sourceforge.net>
Sent: Thursday, December 07, 2000 2:40 PM
Subject: Pythonwin and EVT_CLOSE crash

Using W95, Python 2.0, wxPy 2.2.2

In 2.2.2 you are supposed to use EVT_CLOSE to direct the event to
OnCloseWindow because OnCloseWindow no longer gets called automatically.
When I try this under Pythonwin I get a crash the *second* time I run the
application when I try and close the application.

Is this a Pythonwin problem or a wxPython problem (or something that I am
doing wrong).

Here is the code. If you comment out the EVT_CLOSE line you can run it
repeatedly under Pythonwin. Maybe it consumes more memory each time it is
run, I havent checked.

from wxPython.wx import *

class MainFrame(wxFrame):
    def __init__(self):
        wxFrame.__init__(self, NULL, -1, "Testing...")
        EVT_CLOSE(self, self.OnCloseWindow)

    def OnCloseWindow(self, event):
        print "now in OnCloseWindow"
        self.Destroy()

class SimpleApp(wxApp):
    def OnInit(self):
        self.frame = MainFrame()
        self.SetTopWindow(self.frame)
        self.frame.Show(true)
        return true

app= SimpleApp(0)
app.MainLoop()

Regards,

Gordon Williams

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