-
Notifications
You must be signed in to change notification settings - Fork 0
/
StingerGUI.py
177 lines (155 loc) · 2.88 KB
/
StingerGUI.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
from pathlib import Path
# from tkinter import *
# Explicit imports to satisfy Flake8
from tkinter import Tk, Canvas, Entry, Text, Button, PhotoImage
OUTPUT_PATH = Path(__file__).parent
ASSETS_PATH = OUTPUT_PATH / Path("./assets")
def relative_to_assets(path: str) -> Path:
return ASSETS_PATH / Path(path)
window = Tk()
window.geometry("966x630")
window.configure(bg = "#FFFFFF")
canvas = Canvas(
window,
bg = "#FFFFFF",
height = 630,
width = 966,
bd = 0,
highlightthickness = 0,
relief = "ridge"
)
canvas.place(x = 0, y = 0)
entry_image_1 = PhotoImage(
file=relative_to_assets("entry_1.png"))
entry_bg_1 = canvas.create_image(
129.5,
147.5,
image=entry_image_1
)
entry_1 = Entry(
bd=0,
bg="#FFFFFF",
highlightthickness=0
)
entry_1.place(
x=90.0,
y=128.0,
width=79.0,
height=37.0
)
entry_image_2 = PhotoImage(
file=relative_to_assets("entry_2.png"))
entry_bg_2 = canvas.create_image(
688.5,
339.0,
image=entry_image_2
)
entry_2 = Entry(
bd=0,
bg="#FFFFFF",
highlightthickness=0
)
entry_2.place(
x=444.0,
y=128.0,
width=489.0,
height=420.0
)
entry_image_3 = PhotoImage(
file=relative_to_assets("entry_3.png"))
entry_bg_3 = canvas.create_image(
129.5,
253.5,
image=entry_image_3
)
entry_3 = Entry(
bd=0,
bg="#FFFFFF",
highlightthickness=0
)
entry_3.place(
x=90.0,
y=234.0,
width=79.0,
height=37.0
)
canvas.create_text(
80.0,
97.0,
anchor="nw",
text="Port Forward:",
fill="#000000",
font=("Roboto", 12 * -1)
)
canvas.create_text(
439.0,
97.0,
anchor="nw",
text="Output",
fill="#000000",
font=("Roboto", 12 * -1)
)
canvas.create_text(
80.0,
200.0,
anchor="nw",
text="Log file:",
fill="#000000",
font=("Roboto", 12 * -1)
)
canvas.create_text(
80.0,
172.0,
anchor="nw",
text="(Defualt is 2222)",
fill="#828282",
font=("Roboto", 12 * -1)
)
canvas.create_text(
80.0,
278.0,
anchor="nw",
text="(Defualt is stinger.log)",
fill="#828282",
font=("Roboto", 12 * -1)
)
button_image_1 = PhotoImage(
file=relative_to_assets("button_1.png"))
button_1 = Button(
image=button_image_1,
borderwidth=0,
highlightthickness=0,
command=lambda: print("button_1 clicked"),
relief="flat"
)
button_1.place(
x=80.0,
y=502.0,
width=99.0,
height=40.0
)
button_image_2 = PhotoImage(
file=relative_to_assets("button_2.png"))
button_2 = Button(
image=button_image_2,
borderwidth=0,
highlightthickness=0,
command=lambda: print("button_2 clicked"),
relief="flat"
)
button_2.place(
x=200.0,
y=502.0,
width=99.0,
height=40.0
)
canvas.create_text(
80.0,
18.0,
anchor="nw",
text="Stinger",
fill="#F2C94C",
font=("Roboto", 64 * -1)
)
window.resizable(False, False)
window.mainloop()