From: <bra...@om...> - 2005-03-21 02:25:16
|
I've started building my application around the idea of a main tabbed window with a few small child windows spawned, and it seems to be working, but with one problem. Sometimes, when I quit PythonCard, it appears to hang for a few seconds, and the Python GUI environment crashes. Mac OS X presents a dialog saying that Python has unexpectedly quit, and the terminal shows a 'bus error.' This happens about 50% of the time when I quit my app, but I haven't yet taken the time to nail down a pattern. It may happen more when I spawn child windows. I haven't see this problem yet under Windows XP. Here is how I'm initializing the main window, based on the testNotebook.py sample code: class MainWindow(model.Background): def on_initialize(self, event): # if you have any initialization # including sizer setup, do it here self.printer = HtmlEasyPrinting() # self.loadConfig() self.startTitle = self.title win2 = model.childWindow(self.components.notebook, widgets.WidgetsTest) self.components.notebook.AddPage(win2, 'widgets', True) win3 = model.childWindow(self.components.notebook, doodle.Doodle) self.components.notebook.AddPage(win3, 'doodle', True) win4 = model.childWindow(self.components.notebook, tabEmp.MyBackground) self.components.notebook.AddPage(win4, 'Employees', True) win5 = model.childWindow(self.components.notebook, tabMainMenu.MyBackground) self.components.notebook.AddPage(win5, 'Main', True) page = self.components.notebook.getPage(3) size = page.size wx.CallAfter(page.SetSize, size) print "number of pages:", self.components.notebook.getPageCount() print "last page text: %s\n" % \ self.components.notebook.getPageText(self.components.notebook.getPageCount() - 1) print "stringSelection:", self.components.notebook.stringSelection self.components.notebook.stringSelection = 'Main' |