forked from timonSachweh/smartMirror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirstGui.py
50 lines (34 loc) · 1.72 KB
/
firstGui.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
from Tkinter import *
from view.generalInformationFrame import GeneralInformationFrame
from view.calenderFrame import CalenderFrame
from view.todayTodosFrame import TodayTodosFrame
from view.newsBlockFrame import NewsBlockFrame
class App(Tk):
generalInformation = GeneralInformationFrame
newsBlockFrame = NewsBlockFrame
todayTodosFrame = TodayTodosFrame
kalenderFrame = CalenderFrame
padding = 10
countColumns = 4
countRows = 2
def __init__(self, master):
Tk.__init__(self)
master.configure(background="black")
widthGI = self.winfo_screenwidth() / self.countColumns
heightGeneral = self.winfo_screenheight() / self.countRows
widthNBF = self.winfo_screenwidth() / self.countColumns * 2
widthTDF = widthGI
widthKF = self.winfo_screenwidth() / self.countColumns * 2
self.generalInformation = GeneralInformationFrame(master, width=widthGI, height=heightGeneral)
self.newsBlockFrame = NewsBlockFrame(master, width=widthNBF, height=heightGeneral)
self.todayTodosFrame = TodayTodosFrame(master, width=widthTDF, height=heightGeneral)
self.kalenderFrame = CalenderFrame(master, width=widthKF, height=heightGeneral)
self.generalInformation.grid(row=0, column=0, rowspan=1, columnspan=1, sticky="nsew")
self.newsBlockFrame.grid(row=0, column=1, rowspan=1, columnspan=2, sticky="nsew")
self.todayTodosFrame.grid(row=0, column=3, rowspan=1, columnspan=1, sticky="nsew")
self.kalenderFrame.grid(row=1, column=2, rowspan=1, columnspan=2, sticky="nsew")
root = Tk()
app = App(root)
root.overrideredirect(0)
root.geometry("{0}x{1}+0+0".format(root.winfo_screenwidth(), root.winfo_screenheight()))
root.mainloop()