-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
60 lines (46 loc) · 1.77 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
56
57
58
59
60
import tkinter as tk
from tkinter import ttk
from tkinter.ttk import Style
import sv_ttk
from gui.tab_projects import ProjectsTab
from gui.settings import load_settings, save_settings
from gui.tab_settings import SettingsTab
from gui.tab_task import TaskTab
class Application(tk.Tk):
def __init__(self):
super().__init__()
self.title("Amigo")
self.geometry("900x1100")
self.style = Style()
self.isLlamaInitialized = False
sv_ttk.set_theme("dark")
self.messages = []
self.style.configure('W.TButton', font=('calibri', 18, 'bold', 'underline'), borderwidth='4')
self.style.configure('W.Label', font=('calibri', 13, 'bold'))
# Create the tab control
self.tab_control = ttk.Notebook(self)
# Create tabs
self.settings_frame = ttk.Frame(self.tab_control)
self.task_frame = ttk.Frame(self.tab_control)
self.projects_frame = ttk.Frame(self.tab_control)
# Add tabs to notebook
self.tab_control.add(self.task_frame, text='Task')
self.tab_control.add(self.projects_frame, text='Projects')
self.tab_control.add(self.settings_frame, text='Settings')
# Init UI
self.settings_tab = SettingsTab(self, self.settings_frame)
self.task_tab = TaskTab(self, self.task_frame)
self.projects_tab = ProjectsTab(self, self.projects_frame)
# Init settings
self.settings_file = 'app_settings.json'
load_settings(self)
self.tab_control.pack(expand=1, fill="both")
def on_close(self):
save_settings(self)
self.destroy()
def main(self):
self.protocol("WM_DELETE_WINDOW", self.on_close)
self.mainloop()
if __name__ == "__main__":
app = Application()
app.main()