-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
62 lines (48 loc) · 1.55 KB
/
Copy pathmain.py
File metadata and controls
62 lines (48 loc) · 1.55 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
53
54
55
56
57
58
59
60
61
62
"""
MyApp - Main entry point
Checks for updates on startup, then launches the main window.
"""
import tkinter as tk
from updater import UpdateWizard
APP_VERSION = "2.0.0"
GITHUB_REPO = "your-username/your-repo" # <-- change this
def launch_main_app(root: tk.Tk):
"""Replace the update wizard with the real application UI."""
root.title(f"MyApp v{APP_VERSION}")
root.geometry("700x450")
root.configure(bg="#0f0f0f")
# ── Demo main UI ──────────────────────────────────────────
header = tk.Frame(root, bg="#0f0f0f")
header.pack(fill="x", padx=30, pady=(30, 0))
tk.Label(
header,
text="MyApp",
font=("Segoe UI", 28, "bold"),
fg="#ffffff",
bg="#0f0f0f",
).pack(side="left")
tk.Label(
header,
text=f"v{APP_VERSION}",
font=("Segoe UI", 12),
fg="#555555",
bg="#0f0f0f",
).pack(side="left", padx=(10, 0), pady=(12, 0))
tk.Label(
root,
text="Your application content goes here.",
font=("Segoe UI", 13),
fg="#888888",
bg="#0f0f0f",
).pack(expand=True)
def main():
root = tk.Tk()
root.withdraw() # hide until update check is done
def on_update_done():
"""Called by UpdateWizard when it's finished (skip or done)."""
launch_main_app(root)
root.deiconify()
UpdateWizard(root, APP_VERSION, GITHUB_REPO, on_update_done)
root.mainloop()
if __name__ == "__main__":
main()