summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-05-29 22:05:19 +0200
committeremkael <emkael@tlen.pl>2019-05-29 22:05:19 +0200
commitf0e23167b57f9b942477b6f2b98d84d61dd8e1d7 (patch)
treef3feb39d7c2e7ad0f5591ae89028bd3e187847ac
parente04ad11483782bcfa2eac51dedd6eae2af3f9239 (diff)
Main window now inherits tk.Tk instead of compositing it, to be able to be referenced as winfo_toplevel()
-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()