|
| 1 | +import tkinter as tk |
| 2 | +from tkinter import ttk |
| 3 | + |
| 4 | +class PortfolioApp(tk.Tk): |
| 5 | + def __init__(self): |
| 6 | + super().__init__() |
| 7 | + self.title("My Portfolio") |
| 8 | + self.geometry("400x300") |
| 9 | + |
| 10 | + self.create_widgets() |
| 11 | + |
| 12 | + def create_widgets(self): |
| 13 | + # Create a label for the title |
| 14 | + title_label = ttk.Label(self, text="Welcome to My Portfolio", font=("Helvetica", 16)) |
| 15 | + title_label.pack(pady=10) |
| 16 | + |
| 17 | + # Create a button to go to the projects page |
| 18 | + projects_button = ttk.Button(self, text="View Projects", command=self.show_projects) |
| 19 | + projects_button.pack(pady=5) |
| 20 | + |
| 21 | + # Create a button to show more information |
| 22 | + more_info_button = ttk.Button(self, text="More Information", command=self.show_more_info) |
| 23 | + more_info_button.pack(pady=5) |
| 24 | + |
| 25 | + # Create a button to exit the app |
| 26 | + exit_button = ttk.Button(self, text="Exit", command=self.destroy) |
| 27 | + exit_button.pack(pady=5) |
| 28 | + |
| 29 | + def show_projects(self): |
| 30 | + projects_window = tk.Toplevel(self) |
| 31 | + projects_window.title("My Projects") |
| 32 | + projects_window.geometry("400x300") |
| 33 | + |
| 34 | + # Create a label for the projects page |
| 35 | + projects_label = ttk.Label(projects_window, text="List of Projects", font=("Helvetica", 16)) |
| 36 | + projects_label.pack(pady=10) |
| 37 | + |
| 38 | + # Create project descriptions (you can add more as needed) |
| 39 | + project1_label = ttk.Label(projects_window, text="Project 1: Description of project 1.") |
| 40 | + project1_label.pack(pady=5) |
| 41 | + |
| 42 | + project2_label = ttk.Label(projects_window, text="Project 2: Description of project 2.") |
| 43 | + project2_label.pack(pady=5) |
| 44 | + |
| 45 | + def show_more_info(self): |
| 46 | + info_window = tk.Toplevel(self) |
| 47 | + info_window.title("More Information") |
| 48 | + info_window.geometry("400x300") |
| 49 | + |
| 50 | + # Create labels for more information |
| 51 | + info_label = ttk.Label(info_window, text="Experience, Skills, and Contact Details", font=("Helvetica", 16)) |
| 52 | + info_label.pack(pady=10) |
| 53 | + |
| 54 | + # Add more labels here for additional information about yourself |
| 55 | + experience_label = ttk.Label(info_window, text="Experience: Describe your work experience here.") |
| 56 | + experience_label.pack(pady=5) |
| 57 | + |
| 58 | + skills_label = ttk.Label(info_window, text="Skills: List your skills here.") |
| 59 | + skills_label.pack(pady=5) |
| 60 | + |
| 61 | + contact_label = ttk.Label(info_window, text="Contact: Your contact details (email, phone, etc.).") |
| 62 | + contact_label.pack(pady=5) |
| 63 | + |
| 64 | +if __name__ == "__main__": |
| 65 | + app = PortfolioApp() |
| 66 | + app.mainloop() |
0 commit comments