-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
36 lines (25 loc) · 833 Bytes
/
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
import wx
import clock_panel
import configuration
app_title = 'Kid Clock'
class MainFrame(wx.Frame):
def __init__(self):
super().__init__(parent=None, title=app_title)
# self.SetClientSize(500,500)
panel = wx.Panel(self)
sizer = wx.GridSizer(1, 1, 1)
config = configuration.Config()
wakeup = config.get_wakeup_time()
sleep = config.get_sleep_time()
font_size = config.get_clock_font_size()
print(f'wakeup time: {wakeup.hour}:{wakeup.minute}')
print(f'sleep time: {sleep.hour}:{sleep.minute}')
clock = clock_panel.ClockPanel(panel, wakeup_time=wakeup, sleep_time=sleep, font_size=font_size)
sizer.Add(clock, 0, wx.ALL | wx.EXPAND, 5)
panel.SetSizer(sizer)
self.Show()
if __name__ == '__main__':
app = wx.App()
frame = MainFrame()
frame.Show()
app.MainLoop()