| Total Complexity | 4 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import platform |
||
| 2 | import tkinter as tk |
||
| 3 | import tkinter.ttk as ttk |
||
| 4 | |||
| 5 | import i18n |
||
| 6 | from . import data |
||
| 7 | |||
| 8 | |||
| 9 | class DefinitionClass(ttk.Frame): |
||
| 10 | """ディフィニションクラス. |
||
| 11 | |||
| 12 | 定数を定義しておくプログラム群 |
||
| 13 | |||
| 14 | Args: |
||
| 15 | locale_var (str): ロケーション |
||
| 16 | master (instance): toplevel のインスタンス |
||
| 17 | """ |
||
| 18 | def __init__(self, locale_var, master=None): |
||
| 19 | super().__init__(master) |
||
| 20 | self.dic = i18n.initialize(locale_var) |
||
| 21 | self.TREE_FOLDER = [ |
||
| 22 | ['data/character', self.dic.get_dict("Character")], |
||
| 23 | ['data/occupation', self.dic.get_dict("Occupation")], |
||
| 24 | ['data/space', self.dic.get_dict("Space")], |
||
| 25 | ['data/event', self.dic.get_dict("Event")], |
||
| 26 | ['data/image', self.dic.get_dict("Image")], |
||
| 27 | ['data/nobel', self.dic.get_dict("Novel")] |
||
| 28 | ] |
||
| 29 | self.TITLE_BINARY = data.TITLE_BINARY |
||
| 30 | self.BLANK_IMAGE = data.BLANK_IMAGE |
||
| 31 | self.VERSION = data.__version__ |
||
| 32 | # メニューバーの作成 |
||
| 33 | self.menu_bar = tk.Menu(master) |
||
| 34 | self.master.config(menu=self.menu_bar) |
||
| 35 | # フォントをOSごとに変える |
||
| 36 | pf = platform.system() |
||
| 37 | if pf == 'Windows': |
||
| 38 | self.font = "メイリオ" |
||
| 39 | elif pf == 'Darwin': # MacOS |
||
| 40 | self.font = "Osaka-等幅" |
||
| 41 | elif pf == 'Linux': |
||
| 42 | self.font = "IPAゴシック" |
||
| 43 | else: |
||
| 44 | self.font = "" |
||
| 45 |