Fixed Windows close-tab bug (I think); refactored

This commit SHOULD fix Ctrl-W/menu-bar closing on Windows; also, the code was refactored into a new multiSwitch method
This commit is contained in:
Lucas Thode
2010-10-25 03:16:27 -05:00
parent 776f581b98
commit d7a4f5c5b8
2 changed files with 10 additions and 5 deletions

View File

@@ -104,6 +104,14 @@ class MultiSwitch(wx.Notebook):
self.removal = False
def removeCurrentTab(self):
self.removal = True
self.removeTab(self.GetSelection())
#Deleting a tab might have put us on the "+" tab, make sure we don't stay there
if self.GetSelection() == self.GetPageCount() - 1:
self.SetSelection(self.GetPageCount() - 2)
self.removal = False
def checkAdd(self, event):
if event.Selection == self.GetPageCount() - 1:
if "__WXMSW__" not in wx.PlatformInfo: