summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jfr_playoff/gui/__init__.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/jfr_playoff/gui/__init__.py b/jfr_playoff/gui/__init__.py
index d9c455d..79a1fad 100644
--- a/jfr_playoff/gui/__init__.py
+++ b/jfr_playoff/gui/__init__.py
@@ -3,14 +3,15 @@ from tkinter import ttk
from .tabs import *
-class PlayoffGUI(object):
+class PlayoffGUI(tk.Tk):
def __init__(self):
- self.root = tk.Tk()
+ tk.Tk.__init__(self)
+ self.tabs = {}
def run(self):
- self.notebook = ttk.Notebook(self.root)
+ self.notebook = ttk.Notebook(self)
self.notebook.pack(fill=tk.BOTH, expand=True)
for tab in tabs.__all__:
- tabObj = globals()[tab](self.notebook)
- self.notebook.add(tabObj, text=tabObj.title)
- self.root.mainloop()
+ self.tabs[tab] = globals()[tab](self.notebook)
+ self.notebook.add(self.tabs[tab], text=self.tabs[tab].title)
+ self.mainloop()