-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.py
45 lines (37 loc) · 922 Bytes
/
controller.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
#!/usr/bin/env python3
# coding: utf-8
'''
Created on August 16, 2022
@author: BalthMhs
@society: BossaMuffinConnected
'''
# Constants available in the whole app
# import .global_constants as g_const
# MVC main dependencies
from model import Model
from view import TkView
# Others
# import .lib_display as ds
# ds.printn()
import sys
class Controller:
'''
Classdocs
'''
def __init__(self, p_model, p_view):
self.model = p_model
self.view = p_view
def start(self):
print(">> Setup the window")
self.view.setupWindow(self)
print(">> Setup the first view")
self.view.setupMainView(self)
print(">> Start to loop")
self.view.startMainLoop()
def stopApp(self):
self.view.destroy
sys.exit(0)
if __name__== "__main__":
# Main function
joana_patch = Controller(Model(), TkView())
joana_patch.start()