-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
145 lines (114 loc) · 3.32 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
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
from tkinter import *
from PIL import ImageTk, Image
import change_canvas
def btn_clicked():
global entry1
global entry0
global canvas
global b0
print('User_ID : ',entry1.get())
print('Password: ',entry0.get())
if entry1.get() == '1' and entry0.get() == '1':
canvas.delete("all")
b0.destroy()
entry1.destroy()
entry0.destroy()
change_canvas.Change_Canvas(window)
else:
canvas.itemconfig(tagOrId='error', text = 'Invaid Credentials :)')
print("Button Clicked")
#Button function ends
def handle_click_entry0(event):
global entry0
global canvas
change = StringVar(canvas, value='')
entry0.config(show='*',textvariable = change)
def handle_click_entry1(event):
global entry1
global canvas
change = StringVar(canvas, value='')
entry1.config(textvariable = change)
window = Tk()
window.state("zoomed")
window.title('Ikshana Application')
ico = Image.open('Button/login_page/logo_icon.jpg')
photo = ImageTk.PhotoImage(ico)
window.wm_iconphoto(False, photo)
window.configure(bg = "#ffffff")
canvas = Canvas(
window,
bg = "#ffffff",
height = 1000,
width = 1500,
bd = 0,
highlightthickness = 0,
relief = "ridge")
canvas.place(x = 0, y = 0)
logo = ImageTk.PhotoImage((Image.open("Button/login_page/vector.png")).resize((832,1000), Image.ANTIALIAS))
logo_bg = canvas.create_image(400, 450,image = logo)
entry0_img = PhotoImage(file = f"Button/login_page/img_textBox0.png")
entry0_bg = canvas.create_image(
1200.0, 479,
image = entry0_img)
default_text_password = StringVar(canvas, value='Password')
entry0 = Entry(
bd = 0,
bg = "#ffffff",
font = ('calibre',15,'normal'),
highlightthickness = 0,
textvariable = default_text_password,)
entry0.place(
x = 1010.0, y = 450,
width = 382.0,
height = 55)
entry0.bind("<1>", handle_click_entry0)
entry1_img = PhotoImage(file = f"Button/login_page/img_textBox1.png")
entry1_bg = canvas.create_image(
1200.0, 371.9,
image = entry1_img)
default_text_user = StringVar(canvas, value='User_ID')
entry1 = Entry(
bd = 0,
bg = "#ffffff",
font = ('calibre',15,'normal'),
highlightthickness = 0,
textvariable = default_text_user)
entry1.place(
x = 1010.0, y = 345,
width = 382.0,
height = 55)
entry1.bind("<1>", handle_click_entry1)
img0 = PhotoImage(file = f"Button/login_page/img0.png")
b0 = Button(
window,
image = img0,
borderwidth = 0,
highlightthickness = 0,
command = btn_clicked,
relief = "flat")
b0.place(
x = 1130, y = 600,
width = 132,
height = 44)
sample = PhotoImage(file = f"Button/login_page/Image.png")
robo_img = canvas.create_image(
1200.0, 200,
image = sample)
canvas.create_text(
1190.0, 300.5,
text = " Sign in",
fill = "#4e6fe7",
font = ("HindSiliguri-Bold", int(20.0),'bold'))
canvas.create_text(
1190, 700.0,
text = "Copyright ©2021 Codebugged. All Rights Reserved",
fill = "#000000",
font = ("Roboto-Thin", int(12.0)))
err_msg = canvas.create_text(
1110, 550,
text = "",
fill = "Red",
font = ("Roboto-Thin", int(18.0)),
tag = 'error')
window.resizable(False, False)
window.mainloop()