The wxMessageDialog, by virtue of opening a new window, is causing a new
kill focus event. Since the focus is still technically on your window
(because you are still in the event handler) the event is sent to the same
window again. Once the first event handler exits then the next focus event
goes to the new window.
This behaviour is potentially deifferent on each platform, and possibly even
with different window managers on X.
----- Original Message -----
From: Thomas Lim <[hidden email]>
To: <[hidden email]>
Sent: Sunday, August 01, 1999 9:16 PM
Subject: [wxPython] OnKillFocus get called twice
> wxPython 2.1b1-2
> python 1.5.2-2
> Red Hat 6.0
> I don't understand why the following code gets called twice (wxMessage
> pops up twice):
> def OnKillFocus(self, event):
> print "OnKill Focus()"
> dlg = wxMessageDialog(self, 'OnKill Focus', '', wxOK)
> If I don't include the wxMessageDialog, OnKillFocus is called only
> once. Does anybody have any clue to this?
> wxPython-users maillist - [hidden email] > http://starship.python.net/mailman/listinfo/wxpython-users >