From 031708d9e6be3b768ca0c3e3e8340a4d1f9545a8 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Thu, 11 Nov 2010 18:06:28 +0200 Subject: [PATCH] There can be only ONE ...GraphFrame --- gui/mainFrame.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index ff6832a23..b6a2757d7 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -116,6 +116,8 @@ class MainFrame(wx.Frame): self.addTabId = wx.NewId() self.closeTabId = wx.NewId() + self.graphFrame = None + #Add menu self.SetMenuBar(MainMenuBar()) #self.SetToolBar(MainToolBar(self)) @@ -351,8 +353,11 @@ class MainFrame(wx.Frame): self.waitDialog.Destroy() def openGraphFrame(self, event): - graphFrame = GraphFrame(self) - graphFrame.Show() + if not self.graphFrame: + self.graphFrame = GraphFrame(self) + self.graphFrame.Show() + else: + self.graphFrame.SetFocus() def toggleShipBrowser(self, event): self.GetToolBar().toggleShipBrowser(event)