-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui2.py
177 lines (157 loc) · 3.49 KB
/
gui2.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 Tk, Canvas, Entry, Text, Button, PhotoImage
from tkinter import font as tkfont
from PIL import Image, ImageTk
OUTPUT_PATH = Path(__file__).parent
ASSETS_PATH = OUTPUT_PATH / Path(r"assets2/frame0")
def create_image():
window.destroy()
import sys
# sys.path.append("build")
import gui3
def gen_report():
window.destroy()
import sys
import gui5
def mount_image():
window.destroy()
import sys
import gui7
def decrypt_image():
window.destroy()
import sys
import gui8
def center_window(window,height=600,width=500):
window.update_idletasks()
screen_width = window.winfo_screenwidth()
screen_height = window.winfo_screenheight()
x = (screen_width - width) // 2
y = (screen_height - height) // 2
window.geometry(f"{width}x{height}+{x}+{y}")
def relative_to_assets(path: str) -> Path:
return ASSETS_PATH / Path(path)
window = Tk()
window.wm_iconname("Image your disk")
window.title("IYD")
im = Image.open('assets0/favicon.ico')
photo = ImageTk.PhotoImage(im)
window.wm_iconphoto(True, photo)
window.wm_iconname("IYD")
window.configure(bg = "#202020")
center_window(window)
window.geometry("600x500")
canvas = Canvas(
window,
bg = "#202020",
height = 500,
width = 600,
bd = 0,
highlightthickness = 0,
relief = "ridge"
)
canvas.place(x = 0, y = 0)
image_image_1 = PhotoImage(
file=relative_to_assets("image_1.png"))
image_1 = canvas.create_image(
130.0,
261.0,
image=image_image_1
)
canvas.create_rectangle(
267.0,
0.0,
600.0,
500.0,
fill="#545252",
outline="")
large_font = tkfont.Font(family="JetBrains Mono", size=16, weight="bold")
button_image_1 = PhotoImage(
file=relative_to_assets("button_1.png"))
button_1 = Button(
window,
text="CREATE IMAGE",
font=large_font,
# image=button_image_1,
borderwidth=0,
highlightthickness=0,
highlightbackground="#6C6C6C",
command=create_image,
relief="flat",
bg="#6C6C6C",
fg="white"
)
button_1.place(
x=300.0,
y=51.0,
width=257.0,
height=75.0
)
button_image_2 = PhotoImage(
file=relative_to_assets("button_2.png"))
button_2 = Button(
# image=button_image_2,
borderwidth=0,
text="DECRYPT RAW IMAGE",
highlightthickness=0,
highlightbackground="#6C6C6C",
command=decrypt_image,
relief="flat",
font=large_font,
bg="#6C6C6C",
fg="white"
)
button_2.place(
x=300.0,
y=159.0,
width=257.0,
height=75.0
)
button_image_3 = PhotoImage(
file=relative_to_assets("button_3.png"))
button_3 = Button(
# image=button_image_3,
borderwidth=0,
text="MOUNT IMAGE",
highlightthickness=0,
highlightbackground="#6C6C6C",
relief="flat",
command=mount_image,
font=large_font,
bg="#6C6C6C",
fg="white"
)
button_3.place(
x=300.0,
y=268.0,
width=257.0,
height=75.0
)
button_image_4 = PhotoImage(
file=relative_to_assets("button_4.png"))
button_4 = Button(
# image=button_image_4,
borderwidth=0,
text="GET DRIVE REPORT",
highlightthickness=0,
highlightbackground="#6C6C6C",
relief="flat",
command=gen_report,
font=large_font,
bg="#6C6C6C",
fg="white"
)
button_4.place(
x=300.0,
y=374.0,
width=257.0,
height=75.0
)
image_image_2 = PhotoImage(
file=relative_to_assets("image_2.png"))
image_2 = canvas.create_image(
130.0,
385.0,
image=image_image_2
)
window.resizable(False, False)
window.mainloop()