-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindowCode.html
103 lines (85 loc) · 4.05 KB
/
WindowCode.html
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
<head>
<title>
Interface's Window's Python Code
</title>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<h1>The code for the application's window:</h1>
<pre><code class="python">
#Create window
root = tk.Tk()
#Personalize the window
root.title("GuideForm")
#Edit the window's size
root.geometry("1080x720")
root.minsize(480,360)
canvas = tk.Canvas(root, width='1080', height='720')
canvas.configure(bg='#DCDCDC',highlightthickness=0)
canvas.place(anchor='center')
#Create frame for logo's position
frame = Frame(root, width=50, height=50)
frame.pack()
frame.place(anchor='n', relx=0.5)
# Create an object of tkinter ImageTk
img= PIL.Image.open("/Users/emansarahafi/Downloads/Telegram Files for Project/GuideForm.png")
#Resize the Image using resize method
resized_image= img.resize((200,200), PIL.Image.Resampling.LANCZOS)
new_image= ImageTk.PhotoImage(resized_image)
# Create a Label Widget to display the text or Image
label = Label(frame, image = new_image)
label.pack()
#Add the window's icon
root.iconbitmap("/Users/emansarahafi/Downloads/Telegram Files for Project/GuideForm.ico")
#Add the window's background
root.config(background='#DCDCDC')
#Add decorative dashed line
canvas.create_line(540, 250, 540, 650, dash=(10), width=1)
canvas.pack()
# Create label for explanation
txt = tk.Label(root, text="""\nTashfeen Engineering Solutions is a geotechnical, civil engineering, and software development company
\nestablished in 2020.
\nIt has worked on several projects on national & international scales.
\nThe engineering firm will start to expand overseas, and to do so,
\na survey must be done to understand the young engineers’ qualities overseas.
\nWe chose to begin with Bahrain because the kingdom has a well-established & most recognized
\nengineering infrastructure in the Middle East.
\nThus, kindly answer our survey on our application GuideForm for our research purposes.
\nFor any inquiries, please do not hesitate to contact us on our website.""",foreground="black", height=20, width=80)
txt.configure(background='#DCDCDC')
txt.place(relx = 0.5,rely = 0.5, anchor ='e')
# Create bottom label for company's name
def callback(url):
webbrowser.open_new(url)
pwr = tk.Label(root, text="""Powered by
Tashfeen Engineering Solutions (2022)""", cursor="hand2", fg = "blue")
pwr.configure(background='#DCDCDC',underline=True)
pwr.place(relx = 0.5,rely = 0.95, anchor ='s')
pwr.bind("<Button-1>", lambda e: callback("https://tashfeen.tech/"))
# Create Label to display the Date
w = Label(root, text=f"{dt.datetime.now():%a, %b %d %Y}", foreground="black", background='#DCDCDC', font=("helvetica", 14))
w.place(relx = 0.0,rely = 0.0, anchor ='nw')
def time():
string = strftime('%H:%M:%S %p')
lbl.config(text = string)
lbl.after(1000, time)
lbl = Label(root,foreground="black",background='#DCDCDC', font=("helvetica", 14))
lbl.place(relx = 1.0,rely = 0.0, anchor ='ne')
time()
root.mainloop()
</code></pre>
<footer>
<style>
/* Styling Footer */
footer {
text-align: center;
color: rgb(0, 0, 0);
padding-top: 0px;
}
</style>
<p> Tashfeen Engineering Solutions 2022<br> <a href="https://www.tashfeen.tech"> Powered by Tashfeen</a></p>
</footer>
</body>