-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (35 loc) · 1.03 KB
/
Copy pathmain.py
File metadata and controls
49 lines (35 loc) · 1.03 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
"""
main.py — FlashScan entry point
Launches the pywebview window with the HTML GUI.
"""
from __future__ import annotations
import sys
from pathlib import Path
import webview
# Add parent to sys.path for imports
sys.path.insert(0, str(Path(__file__).parent))
from ui.api import API
UI_DIR = Path(__file__).parent / "ui"
UI_HTML = UI_DIR / "index.html"
def main():
# window_ref_holder: list with one element, populated after create_window
window_ref: list = []
api = API(window_ref)
window = webview.create_window(
title = "FlashScan",
url = str(UI_HTML),
js_api = api,
width = 1000,
height = 680,
min_size = (760, 520),
resizable = True,
frameless = False, # True = hide native titlebar (GUI has its own drag bar)
hidden = True,
)
window_ref.append(window)
def on_started():
window.maximize()
window.show()
webview.start(on_started, debug=False)
if __name__ == "__main__":
main()