A little refactoring to share dialog closing methods

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-04-17 17:01:29 +00:00
parent d398ada042
commit 7d0c892db5
3 changed files with 14 additions and 16 deletions

View File

@@ -16,20 +16,16 @@ class aboutdlg_Tests(wtc.WidgetTestCase):
info.SetCopyright('(c) by Goofy Enterprises, Inc.')
return info
def _closeDlg(self):
for w in wx.GetTopLevelWindows():
if isinstance(w, wx.Dialog):
w.EndModal(wx.ID_OK)
def test_aboutdlgNative(self):
if not 'wxMSW' in wx.PlatformInfo():
info = self._makeInfo()
wx.CallLater(250, self._closeDlg)
wx.CallLater(25, self.closeDialogs)
wx.adv.AboutBox(info, self.frame)
def test_aboutdlgGeneric(self):
info = self._makeInfo()
wx.CallLater(250, self._closeDlg)
wx.CallLater(25, self.closeDialogs)
wx.adv.GenericAboutBox(info, self.frame)