This repository has been archived by the owner on Sep 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
75 lines (55 loc) · 1.95 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import tkinter as tk
from tkinter import messagebox
from tkinter import ttk
import webbrowser
root = tk.Tk()
root.title('shendi - Pathfinder 2nd Edition Character Builder')
root.geometry("400x400")
# Create a PC
def create_pc(pc_name):
print(pc_name)
# Menu Functions
# show about
def show_about():
messagebox.showinfo("About shendi", "This is a project by AucaCoyan#9411. "
"Contact him at Discord or you can check "
"the github at: "
"https://github.com/AucaCoyan/shendi")
def go_to_github():
webbrowser.open_new("https://github.com/AucaCoyan/shendi")
# Creating menu bar
my_menu = tk.Menu(root)
root.config(menu=my_menu)
# Creating File menu Item
file_menu = tk.Menu(my_menu)
my_menu.add_cascade(label="File",
menu=file_menu)
# Creating Help menu Item
help_menu = tk.Menu(my_menu)
my_menu.add_cascade(label="Help",
menu=help_menu)
help_menu.add_command(label="About",
command=show_about)
help_menu.add_command(label="Go to Github repository",
command=go_to_github)
# Text before the field
enter_name_for_pc = tk.Label(root,
text="Enter the name of your character:")
enter_name_for_pc.grid(row=0, column=0)
# Creating an input field
pc_name_field = tk.Entry(root,
width=30)
# Creating the ok button
ok_name = tk.Button(root, text="OK", command=create_pc(enter_name_for_pc.pack()))
# Locations of fields in the grid
enter_name_for_pc.grid(row=0, column=0)
pc_name_field.grid(row=0, column=1)
ok_name.grid(row=0, column=3)
# Tabs
my_notebook = ttk.Notebook()
# bottom limit (where the status bar goes)
# my_notebook.pack(pady=15)
my_frame1 = tk.Frame(my_notebook, width=500, height=500, bg="blue")
my_frame1.pack(fill="both", expand=1)
my_notebook.add(my_frame1, text="PC 1")
root.mainloop()