initial gui

This commit is contained in:
andrei-mihnea-cerbu
2024-01-13 00:21:19 +02:00
parent e56b3a5340
commit 2a9860ebfa
10 changed files with 175 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import tkinter as tk
class LoginView(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.create_widgets()
def create_widgets(self):
# Username Label and Entry
username_label = tk.Label(self, text="Username:")
username_label.pack(pady=5)
self.username_entry = tk.Entry(self)
self.username_entry.pack(pady=5)
# Password Label and Entry
password_label = tk.Label(self, text="Password:")
password_label.pack(pady=5)
self.password_entry = tk.Entry(self, show="*") # Use show="*" to hide password characters
self.password_entry.pack(pady=5)
# Login Button
login_button = tk.Button(self, text="Submit", command=self.on_login)
login_button.pack(pady=10)
def on_login(self):
# Retrieve username and password values
username = self.username_entry.get()
password = self.password_entry.get()
# Example: Check credentials (you'll need to implement your own logic)
if username == "example" and password == "password":
self.master.show_main_view()
else:
print("Invalid credentials")