Total Complexity | 3 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | #!/usr/bin/env python3 |
||
2 | import os |
||
3 | import webbrowser |
||
4 | import tkinter as tk |
||
5 | |||
6 | from . import Definition |
||
7 | |||
8 | |||
9 | class HelpMenuClass(Definition.DefinitionClass): |
||
10 | """ヘルプメニューバーのクラス. |
||
11 | |||
12 | ・ヘルプメニューバーにあるプログラム群 |
||
13 | |||
14 | Args: |
||
15 | app (instance): MainProcessingClass のインスタンス |
||
16 | locale_var (str): ロケーション |
||
17 | master (instance): toplevel のインスタンス |
||
18 | """ |
||
19 | def __init__(self, app, locale_var, master=None): |
||
20 | super().__init__(locale_var, master) |
||
21 | self.app = app |
||
22 | |||
23 | def version(self): |
||
24 | """バージョン情報を表示. |
||
25 | |||
26 | ・バージョン情報表示ダイアログを表示する。 |
||
27 | ×を押すまで消えないようにする。 |
||
28 | """ |
||
29 | img = tk.PhotoImage(data=self.TITLE_BINARY) |
||
30 | window = tk.Toplevel(self.app) |
||
31 | canvas = tk.Canvas(window, width=600, height=300) |
||
32 | canvas.create_image(0, 0, anchor='nw', image=img) |
||
33 | canvas.create_text( |
||
34 | 550, |
||
35 | 290, |
||
36 | anchor='se', |
||
37 | text='Copyright (C) 2019-2020 Yamahara Yoshihiro', |
||
38 | font=('', 12) |
||
39 | ) |
||
40 | canvas.create_text( |
||
41 | 420, |
||
42 | 120, |
||
43 | anchor='nw', |
||
44 | text=self.VERSION, |
||
45 | font=('', 12) |
||
46 | ) |
||
47 | canvas.pack() |
||
48 | window.title(self.dic.get_dict("Novel Editor")) |
||
49 | window.resizable(width=0, height=0) |
||
50 | window.mainloop() |
||
51 | |||
52 | def help(self): |
||
53 | """helpページを開く. |
||
54 | |||
55 | ・ウエブブラウザを使ってREADME.htmlを表示する。 |
||
56 | """ |
||
57 | webbrowser.open( |
||
58 | 'file://' + os.path.abspath(os.getcwd()) |
||
59 | + "/README.html" |
||
60 | ) |
||
61 |