tabs in the gui

This commit is contained in:
Cuptain 2024-06-21 00:52:24 +10:00
parent 2f24519015
commit 824189c2c3

17
Main.py
View File

@ -52,14 +52,23 @@ def main():
app = CTk() app = CTk()
app.title("FamilyCraft Launcher") app.title("FamilyCraft Launcher")
set_appearance_mode("dark") set_appearance_mode("dark")
# Tabs to seperate options from launching the game
guitabs = CTkTabview(master=app)
guitabs.pack(padx=0, pady=0)
guitabs.add("Launcher")
guitabs.add("Options")
#root.title("Select Prism Instance Path") #root.title("Select Prism Instance Path")
# Label for instructions # Label for instructions
label = CTkLabel(master=app, text="Select Prism instance path:", font=("Impact", 30)) label = CTkLabel(master=guitabs.tab("Options"), text="Select Prism instance path:", font=("Impact", 30))
label.pack(pady=10) label.pack(pady=10)
# Entry widget for Prism instance path # Entry widget for Prism instance path
prism_instance_path_entry = CTkEntry(master=app, width=350, font=("Arial", 14)) prism_instance_path_entry = CTkEntry(master=guitabs.tab("Options"), width=350, font=("Arial", 14))
prism_instance_path_entry.pack(pady=5) prism_instance_path_entry.pack(pady=5)
# If a stored Prism instance path exists, pre-fill the entry widget # If a stored Prism instance path exists, pre-fill the entry widget
@ -67,7 +76,7 @@ def main():
prism_instance_path_entry.insert(0, stored_prism_instance_path) prism_instance_path_entry.insert(0, stored_prism_instance_path)
# Button to select directory # Button to select directory
select_button = CTkButton(master=app, text="Browse...", command=select_prism_instance_path) select_button = CTkButton(master=guitabs.tab("Options"), text="Browse...", command=select_prism_instance_path)
select_button.pack(pady=5) select_button.pack(pady=5)
# Function to proceed with installation # Function to proceed with installation
@ -77,7 +86,7 @@ def main():
Backend.perform_installation(instance_name, prism_command, prism_instance_path) Backend.perform_installation(instance_name, prism_command, prism_instance_path)
# Button to start installation # Button to start installation
install_button = CTkButton(master=app, text="Launch Minecraft", command=start_installation) install_button = CTkButton(master=guitabs.tab("Launcher"), text="Launch Minecraft", command=start_installation)
install_button.pack(pady=10) install_button.pack(pady=10)
app.mainloop() app.mainloop()