-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
55 lines (42 loc) · 1.34 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
import time
from tkinter import *
from app import Menu, WindowManager
from util import debug, info
class Application:
"""
NAS GUI Application aka "The Storehouse"
"""
def __init__(self):
self.root = Tk()
self.root.title("The Storehouse")
self.root.configure(bg='#000000')
self.root.geometry('1280x720')
self.root.resizable(False, False)
self.root.focus_force()
self.root.update()
self.menu = Menu(self)
self.menu.show()
self.window_manager = WindowManager(self.root)
self.window_manager.show("Start")
self.fps_counter = Label(master=self.root, bg='#000000', fg='#FFFFFF')
self.fps_counter.place(anchor=SE, x=1280, y=720)
self.time_ = time.time()
self.frames = 0
def update(self):
self.root.update()
self.root.update_idletasks()
self.window_manager.update()
self.frames += 1
time_b = time.time()
diff = time_b - self.time_
if diff > 1:
self.fps_counter.config(text=str(self.frames) + " fps")
self.frames = 0
self.time_ = time.time()
def show(self, content):
self.window_manager.show(content)
if __name__ == '__main__':
info("Starting Application.")
window = Application()
while True:
window.update()