-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprimary.py
68 lines (47 loc) · 2.08 KB
/
primary.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
from tkinter import *
import subprocess
import sys
primary = Tk()
primary.geometry("1200x700")
primary.configure(bg="#E8D09C")
primary.title("Welcome!")
#PARAMETER-----------------------------------------------------------
font_30 = ("Gill Sans MT", 30, "bold")
font_20 = ("Gill Sans MT", 20)
font_15 = ("Gill Sans MT", 15)
pathlogin = "login.py"
argslogin = '"%s" "%s"' % (sys.executable, pathlogin)
pathreg = "register.py"
argsreg = '"%s" "%s"' % (sys.executable, pathreg)
#FUNCTIONS ----------------------------------------------------------
def redirect_l():
primary.destroy()
proc = subprocess.run(argslogin)
def redirect_r():
primary.destroy()
proc = subprocess.run(argsreg)
#WIDGETS-------------------------------------------------------------
#weights
primary.grid_columnconfigure(0, weight=1) #helps with centering , by column
primary.grid_columnconfigure(1, weight=1)
title = Label(primary, text="W E L C O M E", font=font_30, pady=50, bg="#E8D09C")
title.grid(row =0, column=0, columnspan=2, sticky="ew")
frame1 = Frame(primary, padx=20, pady=20, bg="#FFFFFF")
frame1.grid(row=1, column=0)
reglabel = Label(frame1, text="Are you a new member?\n", font=font_20, padx=10, pady=20, bg="#FFFFFF")
reglabel.grid(row=0, column=0)
picreg = PhotoImage(file="./images/picreg.png")
picreglabel = Label(frame1,image=picreg, pady=5, bg="#FFFFFF")
picreglabel.grid(row=1, column=0)
regbutton = Button(frame1, text= "Register here!", font=font_20, padx=10, bg="#FFFFFF", borderwidth=1, command=redirect_r)
regbutton.grid(row=2, column=0)
frame2 = Frame(primary, padx=20, pady=20, bg="#FFFFFF")
frame2.grid(row=1, column=1)
loglabel = Label(frame2, text="Already have an account?\nWelcome back!", font=font_20, padx=10, pady=20, bg="#FFFFFF")
loglabel.grid(row=0, column=0)
piclog = PhotoImage(file="./images/piclog.png")
picloglabel = Label(frame2,image=piclog, pady=5, bg="#FFFFFF")
picloglabel.grid(row=1, column=0)
logbutton = Button(frame2, text= "Login", font=font_20, padx=10, bg="#FFFFFF", borderwidth=1, command=redirect_l)
logbutton.grid(row=2, column=0, ipadx=50)
primary.mainloop()