Skip to content

Commit 1aef911

Browse files
committed
Add Help menu
1 parent 1fcb459 commit 1aef911

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import sys, os, argparse
1212
from modules.pyBjson.utils import uint_to_bytes, int_to_bytes, float_to_bytes
1313

14+
VERSION = "v1.0.2-dev"
15+
1416
def getBjsonContent(fp: str|Path):
1517
try:
1618
data = convertBjsonToJson(fp)
@@ -170,6 +172,11 @@ def __init__(self, fp = None):
170172
file_menu.add_command(label="Exit", command=self.closeApp)
171173

172174
menubar.add_cascade(label="File", menu=file_menu, underline=0)
175+
176+
help_menu = tkinter.Menu(menubar, tearoff=False)
177+
help_menu.add_command(label="About", command=self.showAbout)
178+
179+
menubar.add_cascade(label="Help", menu=help_menu, underline=0)
173180
# -------------------------------
174181

175182
self.propertiesFrame = tkinter.Frame(self)
@@ -364,6 +371,10 @@ def askForChanges(self):
364371
return True
365372
else:
366373
return False
374+
375+
def showAbout(self):
376+
about_text = f"MC3DS BJSON Editor\nVersion {VERSION}\n\nMade by: STBrian\nGitHub: https://github.com/STBrian"
377+
tkinter.messagebox.showinfo("About", about_text)
367378

368379
if __name__ == "__main__":
369380
parser = argparse.ArgumentParser(description='A MC3DS BJSON Editor')

0 commit comments

Comments
 (0)