[wxPython] wxPostEvent trouble

Hello,

I found that after "wxPostEvent(target,e)" if target window is closed, result
is GPF. I use NT4/SP3 wxPython 2.1.14-20000227.

Here is test case. Just press any key and immediately close window with mouse.

Niki Spahiev
e-mail: niki@vintech.bg

Post.py (1.1 KB)

···

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

Using Win2K and the supplied example, I did NOT see a GPF.
FWIW

ET

···

----- Original Message -----
From: "Niki Spahiev" <niki.spahiev@usa.net>
To: <wxpython-users@wxwindows.org>
Sent: Wednesday, April 19, 2000 12:42 PM
Subject: [wxPython] wxPostEvent trouble

Hello,

I found that after "wxPostEvent(target,e)" if target window is closed,
result
is GPF. I use NT4/SP3 wxPython 2.1.14-20000227.

Here is test case. Just press any key and immediately close window with
mouse.

Niki Spahiev
e-mail: niki@vintech.bg

____________________________________________________________________
Get free email and a permanent address at Net@ddress Mail

----------------------------------------------------------------------------
----

from wxPython.wx import *
import time

#---------------------------------------------------------------------------

class RootFrame(wxFrame):
    def __init__(self, parent, id, title):
        wxFrame.__init__(self, parent, id, title, (100,10), (400, 300))
        EVT_CHAR( self, self.Dump )
        EVT_COMMAND( self, 42, wxEVT_COMMAND_MENU_SELECTED, self.Cmd )

    def Dump(self, event):
        kk = event.KeyCode()
        event = wxPyCommandEvent( wxEVT_COMMAND_MENU_SELECTED )
        event.SetId( 42 )
## self.GetEventHandler().ProcessEvent( event )
        wxPostEvent( self, event )
        print 'char', kk, event
        time.sleep(1)

    def Cmd(self, event):
        print 'menu', event

    def OnCloseWindow(self, event):
        self.Destroy()

#---------------------------------------------------------------------------

class MyApp(wxApp):
    def OnInit(self):
        frame = RootFrame(NULL, -1, "Root")
        frame.Show(true)
        self.SetTopWindow(frame)
        return true

#---------------------------------------------------------------------------

app = MyApp(None)
app.MainLoop()