From: Kevin A. <ka...@us...> - 2004-10-10 23:51:12
|
Update of /cvsroot/pythoncard/PythonCard/tools/oneEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23090 Modified Files: tabcodeEditor.py Log Message: added workaround for pageChanged event not firing on Mac wxPython 2.5.2.8 Index: tabcodeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/oneEditor/tabcodeEditor.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tabcodeEditor.py 10 Oct 2004 23:02:08 -0000 1.7 --- tabcodeEditor.py 10 Oct 2004 23:51:00 -0000 1.8 *************** *** 525,530 **** --- 525,548 ---- def closeTab(self): + self.pageChangedFired = False + del self.pages[self.currentPageNumber] self.components.notebook.DeletePage(self.currentPageNumber) + + # KEA 2004-10-10 + # workaround pageChanged event not firing on Mac OS X + # when it gets fixed, this code should be harmless + if not self.pageChangedFired: + selection = self.components.notebook.GetSelection() + #print selection, len(self.pages) + if selection <= len(self.pages) - 1: + self.currentPageNumber = selection + self.currentPage = self.pages[selection] + self.currentDocument = self.currentPage.components.document + self.currentPage.becomeFocus() + self.updateStatusBar() + self.updateTitleBar() + self.setResourceFile() + if len(self.pages) == 0: if NEVER_BLANK: *************** *** 1236,1239 **** --- 1254,1258 ---- def on_notebook_pageChanged(self, event): + self.pageChangedFired = True #rint "pageChanged - oldSelection: %d, selection: %d" % (event.oldSelection, event.selection) if event.selection <= len(self.pages)-1: |