In my dialog, I have defined:
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
self.Bind(wx.EVT_BUTTON, self.OnCloseWindow, id = wx.ID_CANCEL)
(the first for Alt-F4 or clicking the window decorator, the second one
for Esc Key and pressing Cancel button)
If I want to close the window with Alt-F4 or klicking the cross window,
the OnCloseWindow is called twice. (at least on gtk, it behaves that
way).
Cody Precord wrote:
Hi,
In my dialog, I have defined:
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
self.Bind(wx.EVT_BUTTON, �self.OnCloseWindow, id = wx.ID_CANCEL)
(the first for Alt-F4 or clicking the window decorator, the second one
for Esc Key and pressing Cancel button)
If I want to close the window with Alt-F4 or klicking the cross window,
the OnCloseWindow is called twice. (at least on gtk, it behaves that
way).
Are you calling event.Skip() in the event handler?
If so then you should not call Skip in this case since you don't want
the other event handlers in the chain to be called.
Cody
Yes indeed I do, I thought i had to do it that way;
def OnCloseWindow(self, event):
print "OnClose"
if not self.insearch:
self.SaveHistory()
event.Skip()
Thank your for your reply.
···
On Wed, Aug 4, 2010 at 5:22 PM, FranzSt <franz.steinhaeusler@gmx.at> wrote: