Total Complexity | 4 |
Total Lines | 46 |
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 | |||
19 | def __init__(self, locale_var, master=None): |
||
20 | super().__init__(master) |
||
21 | self.dic = i18n.initialize(locale_var) |
||
22 | self.TREE_FOLDER = [ |
||
23 | ["data/character", self.dic.get_dict("Character")], |
||
24 | ["data/occupation", self.dic.get_dict("Occupation")], |
||
25 | ["data/space", self.dic.get_dict("Space")], |
||
26 | ["data/event", self.dic.get_dict("Event")], |
||
27 | ["data/image", self.dic.get_dict("Image")], |
||
28 | ["data/nobel", self.dic.get_dict("Novel")], |
||
29 | ] |
||
30 | self.TITLE_BINARY = data.TITLE_BINARY |
||
31 | self.BLANK_IMAGE = data.BLANK_IMAGE |
||
32 | self.VERSION = data.__version__ |
||
33 | # メニューバーの作成 |
||
34 | self.menu_bar = tk.Menu(master) |
||
35 | self.master.config(menu=self.menu_bar) |
||
36 | # フォントをOSごとに変える |
||
37 | pf = platform.system() |
||
38 | if pf == "Windows": |
||
39 | self.font = "メイリオ" |
||
40 | elif pf == "Darwin": # MacOS |
||
41 | self.font = "Osaka-等幅" |
||
42 | elif pf == "Linux": |
||
43 | self.font = "IPAゴシック" |
||
44 | else: |
||
45 | self.font = "" |
||
46 |