diff options
author | emkael <emkael@tlen.pl> | 2019-07-25 17:17:30 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-07-25 17:17:30 +0200 |
commit | 7879c847b3b1aa2a9b6775e38dbad22de5b37e96 (patch) | |
tree | bca7896acf6e090f6a098422b9c1e56d2f62bad7 /jfr_playoff/gui/__init__.py | |
parent | e5620ec415e677603e0144e367dec938504c4c2d (diff) |
Menubar items for script run
Diffstat (limited to 'jfr_playoff/gui/__init__.py')
-rw-r--r-- | jfr_playoff/gui/__init__.py | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/jfr_playoff/gui/__init__.py b/jfr_playoff/gui/__init__.py index 09d9c98..a0dedc9 100644 --- a/jfr_playoff/gui/__init__.py +++ b/jfr_playoff/gui/__init__.py @@ -10,7 +10,8 @@ import tkMessageBox as tkmb from .tabs import * from .icons import GuiImage -from .frames import LabelButton +from .frames import LabelButton, NumericSpinbox +from .variables import NumericVar class PlayoffGUI(tk.Tk): def __init__(self): @@ -84,6 +85,28 @@ class PlayoffGUI(tk.Tk): menu, image=GuiImage.get_icon(icon), command=command, tooltip=tooltip, label=statusBar) self.menuButtons[icon].pack(side=tk.LEFT) + (ttk.Separator(menu, orient=tk.VERTICAL)).pack( + side=tk.LEFT, fill=tk.Y, padx=3, pady=1) + for icon, command, tooltip in [ + ('run-once', self.onRunOnce, 'Wygeneruj'), + ('run-timed', self.onRunTimed, 'Generuj co X sekund')]: + self.menuButtons[icon] = LabelButton( + menu, image=GuiImage.get_icon(icon), command=command, + tooltip=tooltip, label=statusBar) + self.menuButtons[icon].pack(side=tk.LEFT) + self.interval = NumericVar() + self.intervalField = NumericSpinbox( + menu, width=5, + textvariable=self.interval, from_=30, to=3600) + self.intervalField.pack(side=tk.LEFT) + (ttk.Label(menu, text='sekund')).pack(side=tk.LEFT) + for icon, command, tooltip in [ + ('log', self.onLogWindowOpen, 'Dziennik komunikatów')]: + self.menuButtons[icon] = LabelButton( + menu, image=GuiImage.get_icon(icon), command=command, + tooltip=tooltip, label=statusBar) + self.menuButtons[icon].pack(side=tk.LEFT) + def onNewFile(self): self._checkSave() @@ -114,6 +137,15 @@ class PlayoffGUI(tk.Tk): filename = filename + '.jtpo' self.saveFile(filename) + def onRunOnce(self): + pass + + def onRunTimed(self): + pass + + def onLogWindowOpen(self): + pass + def newFile(self): self._filepath = None self.newFileIndex += 1 |