def tearDownClass(cls): if not MANUAL: cls.app.test_frame.Destroy() wx.CallAfter(cls.app.Exit) elif INSPECT: from wx.lib import inspection inspection.InspectionTool().Show() cls.app.MainLoop()
def tearDownClass(cls): if not MANUAL: cls.app.test_frame.Destroy() # see fixme in runall.py. Is this needed in Phoenix? # wx.CallAfter(cls.app.Exit) elif INSPECT: from wx.lib import inspection inspection.InspectionTool().Show() cls.app.MainLoop()
def inspect(event): from wx.lib import inspection inspection.InspectionTool().Show()
notebook.AddPage(explorer, 'Explorer') sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(notebook, 1, wx.ALL|wx.EXPAND, 5) panel.SetSizer(sizer) # Empties temp and destroys the main frame which quits the wxPython application def OnExitApp(self, event): tmp_cats =[f for f in os.listdir( tmp_img_pth) if os.path.isfile(os.path.join(tmp_img_pth, f))] for f in tmp_cats: os.remove(os.path.join(tmp_img_pth, f)) self.Destroy() def OnCloseFrame(self, event): dialog = wx.MessageDialog(self, message = "Are you sure you want to quit?", caption = "Caption", style = wx.YES_NO, pos = wx.DefaultPosition) response = dialog.ShowModal() if (response == wx.ID_YES): self.OnExitApp(event) else: event.StopPropagation() if __name__ == "__main__": app = wx.App() frame = Main() frame.Show() import wx.lib.inspection as wxli wxli.InspectionTool().Show() app.MainLoop() #app.MainLoop()