-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
56 lines (43 loc) · 1.96 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
# importações de módulos
from tkinter import Tk, font
from tkinter import Button, Label
from PIL import ImageTk, Image
# importações de arquivos do programa
import login
# instanciando tkinter
root = Tk()
# classe principal
class Main:
def __init__(self) -> None:
# referenciando
self.root = root
# chamando métodos da classe
self.configuarJanela()
self.inserirImagens()
self.criarBotoes()
# gerando o loop infinito da tela
self.root.mainloop()
# método para configuração da tela principal
def configuarJanela(self) -> None:
self.root.title('Sistema Escolar')
self.root.geometry('890x500')
self.root.resizable(False, False)
# método para pegar as imagens
def inserirImagens(self) -> None:
self.fotoFundo = ImageTk.PhotoImage(Image.open('images/fundo.jpg'))
self.labelFundo = Label(self.root, image=self.fotoFundo)
self.labelFundo.place(relx=0, rely=-0, relwidth=1, relheight=1)
# criar botões
def criarBotoes(self) -> None:
self.btnEstudantes = Button(self.root, text='Estudantes', bg='#FF8C00', fg='white', bd=0,
activebackground='#FF4500', activeforeground='white',
command=lambda: login.Login(self.root))
self.btnEstudantes.place(relx=0.01, rely=0.05, relwidth=0.14, relheight=0.1)
self.btnProfessores = Button(self.root, text='Professores', bg='#DC143C', fg='white', bd=0,
activebackground='#B22222', activeforeground='white', command=lambda: login.Login(self.root))
self.btnProfessores.place(relx=0.01, rely=0.2, relwidth=0.14, relheight=0.1)
self.btnDirecao = Button(self.root, text='Direção', bg='#483D8B', fg='white', bd=0,
activebackground='#4B0082', activeforeground='white', command=lambda: login.Login(self.root))
self.btnDirecao.place(relx=0.01, rely=0.35, relwidth=0.14, relheight=0.1)
# chamando classe
Main()