-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoots.py
More file actions
52 lines (43 loc) · 1.64 KB
/
Roots.py
File metadata and controls
52 lines (43 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from tkinter import *
import customtkinter as ctk
import time
import sys
import os
class Roots:
root = ctk.CTk(fg_color="#101519")
initialFrame = ctk.CTkFrame(root, fg_color="#101519")
WindowsFrame = ctk.CTkFrame(root, fg_color="#101519")
writeButtonFrame = ctk.CTkFrame(root, fg_color="#101519")
root.geometry("1800x900")
root.title("Masons WrldBox Modding Starter")
if getattr(sys, 'frozen', False):
# Running as a PyInstaller executable
icon_path = os.path.join(sys._MEIPASS, 'Icon.ico')
else:
# Running as a regular Python script
icon_path = 'Icon.ico'
root.iconbitmap(icon_path)
initialFrame.grid(row=0, column=0, padx=4, pady=0)
WindowsFrame.grid(row=0, column=1, padx=20, pady=0)
writeButtonFrame.grid(row=1, column=1, padx=20, pady=0)
def close_root():
Roots.root.destroy()
def loading_window():
loading = ctk.CTk(fg_color="#101519")
loading.geometry("300x100")
loading.title("Creating Mod")
label = ctk.CTkLabel(loading, text="Creating Mod...", font=("Arial", 12))
label.pack(pady=10)
progressbar = ctk.CTkProgressBar(loading, mode="determinate")
progressbar.pack(pady=10)
progressbar.start() # Start the progress bar animation
def simulate_task():
# Simulate some time-consuming task
for _ in range(20):
loading.update_idletasks()
time.sleep(0.1)
loading.update()
progressbar.stop()
loading.destroy()
Roots.close_root() # Close the main application
loading.after(100, simulate_task)