2022-08-30 12:28:59 +02:00
|
|
|
import tkinter as tk
|
|
|
|
from tkinter import ttk
|
2022-08-30 21:12:04 +02:00
|
|
|
from controller.Frames import Frames
|
|
|
|
from controller.HomeController import HomeController
|
2022-08-30 12:28:59 +02:00
|
|
|
|
2022-08-30 21:12:04 +02:00
|
|
|
class HomeView(ttk.Frame):
|
|
|
|
"""
|
|
|
|
View - MainWindow
|
|
|
|
|
|
|
|
dec...
|
|
|
|
|
|
|
|
@author Jérémi Nihart / EndMove
|
|
|
|
@link https://git.endmove.eu/EndMove/WebPicDownloader
|
|
|
|
@version 1.0.0
|
|
|
|
@since 2022-08-30
|
|
|
|
"""
|
|
|
|
# Variables
|
|
|
|
__controller: HomeController = None
|
|
|
|
|
|
|
|
# Constructor
|
|
|
|
def __init__(self, parent, controller: HomeController):
|
2022-08-30 12:28:59 +02:00
|
|
|
super().__init__(parent)
|
|
|
|
|
|
|
|
# create widgets
|
|
|
|
# label
|
|
|
|
self.label = ttk.Label(self, text='Email:')
|
|
|
|
self.label.grid(row=1, column=0)
|
|
|
|
|
|
|
|
# email entry
|
|
|
|
self.email_var = tk.StringVar()
|
|
|
|
self.email_entry = ttk.Entry(self, textvariable=self.email_var, width=30)
|
|
|
|
self.email_entry.grid(row=1, column=1, sticky=tk.NSEW)
|
|
|
|
|
|
|
|
# save button
|
2022-08-30 21:12:04 +02:00
|
|
|
self.save_button = ttk.Button(self, text='Save', command=self.event_btn)
|
2022-08-30 12:28:59 +02:00
|
|
|
self.save_button.grid(row=1, column=3, padx=10)
|
|
|
|
|
|
|
|
# message
|
2022-08-30 21:12:04 +02:00
|
|
|
self.message_label = ttk.Label(self, text='coucou toi :D JE SUIS SUPER MAN héhéh', foreground='red')
|
2022-08-30 12:28:59 +02:00
|
|
|
self.message_label.grid(row=2, column=1, sticky=tk.W)
|
|
|
|
|
2022-08-30 21:12:04 +02:00
|
|
|
# place this frame
|
|
|
|
# self.grid(row=0, column=0, padx=5, pady=5)
|
|
|
|
# self.pack(fill='both', expand=True)
|
2022-08-30 12:28:59 +02:00
|
|
|
|
2022-08-30 21:12:04 +02:00
|
|
|
# Save and setup main controller
|
|
|
|
self.__controller = controller
|
|
|
|
controller.set_view(self)
|
2022-08-30 12:28:59 +02:00
|
|
|
|
2022-08-30 21:12:04 +02:00
|
|
|
def event_btn(self) -> None:
|
|
|
|
print("you clicked ! And now you are on info page ... :D")
|
|
|
|
self.__controller.on_change_view(Frames.Info)
|