diff options
author | emkael <emkael@tlen.pl> | 2019-06-27 13:58:07 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-06-27 14:01:38 +0200 |
commit | 8d9100f32b50e24ee030ec88ccf3d74650225b23 (patch) | |
tree | c4f04ec4644b772a2f286f6ecd2c876a4dbdac68 /jfr_playoff | |
parent | 9a7d11962c4d55a330af6e0aaf26f83df18c4ff5 (diff) |
Main window title
Diffstat (limited to 'jfr_playoff')
-rw-r--r-- | jfr_playoff/gui/__init__.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/jfr_playoff/gui/__init__.py b/jfr_playoff/gui/__init__.py index 0b17b2e..02ef3bb 100644 --- a/jfr_playoff/gui/__init__.py +++ b/jfr_playoff/gui/__init__.py @@ -1,4 +1,4 @@ -import json, sys +import json, os, sys import tkinter as tk from tkinter import ttk @@ -13,6 +13,9 @@ class PlayoffGUI(tk.Tk): self.geometry('920x640') self.tabs = {} self.newFileIndex = 0 + self._title = tk.StringVar() + self._title.trace('w', self._setTitle) + self._dirty = False def run(self): self.notebook = ttk.Notebook(self) @@ -35,10 +38,18 @@ class PlayoffGUI(tk.Tk): def newFile(self): self.newFileIndex += 1 - self.title('Nowa drabinka %d' % (self.newFileIndex)) + self._title.set('Nowa drabinka %d' % (self.newFileIndex)) self._resetValues() + def _setTitle(self, *args): + self.title('%s - %s%s' % ( + 'TeamyPlayOff', + self._title.get(), + '* ' if self._dirty else '' + )) + def openFile(self, filepath): + self._title.set(os.path.basename(filepath)) self._setValues(json.load(open(filepath))) def getDbConfig(self): |