53 lines
1.7 KiB
Python
53 lines
1.7 KiB
Python
|
import tkinter as tk
|
||
|
from tkinter import ttk
|
||
|
from controller.Frames import Frames
|
||
|
from controller.InfoController import InfoController
|
||
|
|
||
|
class InfoView(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: InfoController = None
|
||
|
|
||
|
# Constructor
|
||
|
def __init__(self, parent, controller: InfoController):
|
||
|
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
|
||
|
self.save_button = ttk.Button(self, text='just a button', command=self.event_btn)
|
||
|
self.save_button.grid(row=1, column=3, padx=10)
|
||
|
|
||
|
# message
|
||
|
self.message_label = ttk.Label(self, text='Je suis super man comment allez vous heheheh je suis toutou', foreground='red')
|
||
|
self.message_label.grid(row=2, column=0, sticky=tk.EW)
|
||
|
|
||
|
# place this frame
|
||
|
# self.grid(row=0, column=0, padx=5, pady=5, sticky=tk.NSEW)
|
||
|
# self.pack(fill='both', expand=True)
|
||
|
|
||
|
# Save and setup main controller
|
||
|
self.__controller = controller
|
||
|
controller.set_view(self)
|
||
|
|
||
|
def event_btn(self) -> None:
|
||
|
print("you clicked on the button that is on the info view!")
|
||
|
print("got redirected to the home view :D")
|
||
|
self.__controller.on_change_view(Frames.Home)
|