Fix bug when opening another project while current edited project has at least one tab opened
--- a/PLCOpenEditor.py Sun Oct 09 20:04:35 2011 +0200
+++ b/PLCOpenEditor.py Sun Oct 09 20:10:36 2011 +0200
@@ -1203,10 +1203,12 @@
if USE_AUI:
for child in self.TabsOpened.GetChildren():
if isinstance(child, wx.aui.AuiTabCtrl):
- window = child.GetWindowFromIdx(child.GetActivePage())
- window.RefreshView()
- if not window.IsDebugging() and self.TabsOpened.GetPageIndex(window) == selected and variablepanel:
- self.RefreshVariablePanel(window.GetTagName())
+ active_page = child.GetActivePage()
+ if active_page >= 0:
+ window = child.GetWindowFromIdx(child.GetActivePage())
+ window.RefreshView()
+ if not window.IsDebugging() and self.TabsOpened.GetPageIndex(window) == selected and variablepanel:
+ self.RefreshVariablePanel(window.GetTagName())
elif selected >= 0:
window = self.TabsOpened.GetPage(idx)
window.RefreshView()