Source code for menu

import tkinter as tk

from trainrecognizerpage import TrainRecognizerPage
from calendarloginpage import CalendarLoginPage





[docs]class StartPage(tk.Frame): """Menu's 'base' page. StartPage inherit's from tkinter's frame class. It acts as a container of buttons used to navigate to different menu pages. """ def __init__(self, master, controller): tk.Frame.__init__(self, master) self._controller = controller self.grid_columnconfigure(0, weight=1) self.grid_rowconfigure(0, weight=1) self.grid_rowconfigure(1, weight=1) self.grid_rowconfigure(2, weight=1) self._train_recognizer_button = tk.Button(self, text='Add Face', relief=tk.GROOVE, command=lambda: master.show_frame('TrainRecognizerPage')) self._calendar_login_button = tk.Button(self, text='Log in to Calendar', relief=tk.GROOVE, command=lambda: master.show_frame('CalendarLoginPage')) self._start_smartmirror_button = tk.Button(self, text='Start SmartMirror', relief=tk.GROOVE, command=lambda: controller.start_smartmirror()) self._train_recognizer_button.grid(row=0, column=0, pady=5) self._calendar_login_button.grid(row=1, column=0, pady=5) self._start_smartmirror_button.grid(row=2, column=0, pady=5)