summaryrefslogtreecommitdiff
path: root/jfr_playoff/gui
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-07-19 12:06:20 +0200
committeremkael <emkael@tlen.pl>2019-07-19 12:06:20 +0200
commit3030cb12a4756c9db305423554b7910860d1aeaa (patch)
tree2fbc256cfb3806591c637ebd68a11bf947a2110f /jfr_playoff/gui
parent914c73d5aa2d87d55bcc10b3bf5cfd4d4f6a8f93 (diff)
Icons
Diffstat (limited to 'jfr_playoff/gui')
-rw-r--r--jfr_playoff/gui/icons.py28
-rw-r--r--jfr_playoff/gui/icons/new.gifbin0 -> 581 bytes
-rw-r--r--jfr_playoff/gui/icons/open.gifbin0 -> 1015 bytes
-rw-r--r--jfr_playoff/gui/icons/save.gifbin0 -> 621 bytes
-rw-r--r--jfr_playoff/gui/icons/saveas.gifbin0 -> 603 bytes
5 files changed, 28 insertions, 0 deletions
diff --git a/jfr_playoff/gui/icons.py b/jfr_playoff/gui/icons.py
new file mode 100644
index 0000000..12350ec
--- /dev/null
+++ b/jfr_playoff/gui/icons.py
@@ -0,0 +1,28 @@
+import os, sys
+
+import Tkinter as tk
+
+class GuiImage(object):
+ icons = {}
+
+ @staticmethod
+ def __get_base_path():
+ try:
+ return os.path.join(sys._MEIPASS, 'res')
+ except:
+ return os.path.abspath(os.path.dirname(__file__))
+
+ @staticmethod
+ def get_path(imageType, code, fileType='gif'):
+ return os.path.join(GuiImage.__get_base_path(), imageType, '%s.%s' % (code, fileType))
+
+ @staticmethod
+ def __get_image(imageType, cache, code, fileType='gif'):
+ if code not in cache:
+ path = GuiImage.get_path(imageType, code, fileType)
+ cache[code] = tk.PhotoImage(file=path)
+ return cache[code]
+
+ @staticmethod
+ def get_icon(code):
+ return GuiImage.__get_image('icons', GuiImage.icons, code)
diff --git a/jfr_playoff/gui/icons/new.gif b/jfr_playoff/gui/icons/new.gif
new file mode 100644
index 0000000..e816390
--- /dev/null
+++ b/jfr_playoff/gui/icons/new.gif
Binary files differ
diff --git a/jfr_playoff/gui/icons/open.gif b/jfr_playoff/gui/icons/open.gif
new file mode 100644
index 0000000..c7adaf2
--- /dev/null
+++ b/jfr_playoff/gui/icons/open.gif
Binary files differ
diff --git a/jfr_playoff/gui/icons/save.gif b/jfr_playoff/gui/icons/save.gif
new file mode 100644
index 0000000..4452f38
--- /dev/null
+++ b/jfr_playoff/gui/icons/save.gif
Binary files differ
diff --git a/jfr_playoff/gui/icons/saveas.gif b/jfr_playoff/gui/icons/saveas.gif
new file mode 100644
index 0000000..25cde78
--- /dev/null
+++ b/jfr_playoff/gui/icons/saveas.gif
Binary files differ