Add DestroyLater

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2013-02-22 06:20:26 +00:00
parent 766893c4b9
commit d108a412d0

View File

@@ -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?