From d108a412d09f2eca498267f1b466ea231b4ad06e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 22 Feb 2013 06:20:26 +0000 Subject: [PATCH] Add DestroyLater git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- etg/window.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/etg/window.py b/etg/window.py index c9d645f0..27ef69b7 100644 --- a/etg/window.py +++ b/etg/window.py @@ -169,6 +169,20 @@ def run(): return not wx.siplib.isdeleted(self) """) c.addPyCode('Window.__bool__ = Window.__nonzero__') # For Python 3 + + + c.addPyMethod('DestroyLater', '(self)', + doc="""\ + Schedules the window to be destroyed in the near future. + + This should be used whenever Destroy could happen too soon, such + as when there may still be events for this window or its children + waiting in the event queue. + """, + body="""\ + self.Hide() + wx.GetApp().ScheduleForDestruction(self) + """) # MSW only. Do we want them wrapped?