-
Notifications
You must be signed in to change notification settings - Fork 0
/
Paluh.py
89 lines (59 loc) · 1.6 KB
/
Paluh.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
from tkinter import *
from PIL import Image
import ttkbootstrap as ttk
from Main_Paluh import Main_Paluh
from util.util import Util
splash = Tk()
altura = 500
largura = 500
util = Util()
x = (splash.winfo_screenwidth()//2)-(largura//2)
y = (splash.winfo_screenheight()//2)-(altura//2)
splash.geometry('{}x{}+{}+{}'.format(largura,altura,x,y))
backgroundImage = PhotoImage(file=util.CAMINHO_IMAGEM.__str__()+'\\Background.png')
bg_image = Label(
splash,
image=backgroundImage
)
bg_image.pack()
splash.overrideredirect(True)
labelAguarde = Label(
splash,
text="LabMax",
font=("yu gothic ui bold", 30 * -1),
bg="#1F41A9",
fg="#ed9c32"
)
labelAguarde.place(x=200, y=100)
labelAguarde = Label(
splash,
text="Aguarde...",
font=("yu gothic ui bold", 15 * -1),
bg="#1F41A9",
fg="#FFFFFF"
)
labelAguarde.place(x=220, y=350)
gifImage = util.CAMINHO_IMAGEM.__str__()+'\\load.gif'
openImage = Image.open(gifImage)
frames = openImage.n_frames
imageObject = [PhotoImage(file=gifImage, format=f"gif -index {i}") for i in range(frames)]
count = 0
showAnimation = None
gif_Label = Label(splash, image="")
gif_Label.place(x=200, y=220, width=100, height=100)
def main_window():
splash.destroy()
app = ttk.Window()
Main_Paluh(app)
app.mainloop()
def animation(count):
global showAnimation
newImage = imageObject[count]
gif_Label.configure(image=newImage)
count += 1
if count == frames:
count = 0
showAnimation = splash.after(50, lambda: animation(count))
animation(count)
splash.after(1000, lambda: main_window())
splash.mainloop()