MCPcopy Index your code
hub / github.com/LCBOWER33/StegoScan / create_gui

Function create_gui

StegoScan.py:1357–1745  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1355
1356
1357def create_gui():
1358 root = tb.Window(themename="darkly") # Apply dark theme
1359 root.title("StegoScan")
1360
1361 # Load the icon image
1362 response = requests.get(
1363 "https://raw.githubusercontent.com/LCBOWER33/StegoScan/main/images/StegoScan_dark_logo.png",
1364 timeout=5
1365 )
1366 response.raise_for_status()
1367
1368 img_data = response.content
1369 img = Image.open(io.BytesIO(img_data)).convert("RGBA")
1370 img = img.resize((32, 32), Image.LANCZOS)
1371
1372 icon_photo = ImageTk.PhotoImage(img)
1373 root.icon_photo = icon_photo # Prevent garbage collection
1374 root.iconphoto(True, icon_photo) # Works on macOS/Linux
1375
1376 # Make the window full screen
1377 # root.attributes("-fullscreen", True)
1378 root.configure(bg="#191B1D")
1379 root.geometry("1050x975") # Optional, in case you want a fallback size for non-fullscreen
1380 root.resizable(True, True)
1381
1382 # Function to toggle full screen on Escape key press
1383 def toggle_full_screen(event=None):
1384 """ Toggle between full screen and windowed mode. """
1385 current_state = root.attributes("-fullscreen")
1386 root.attributes("-fullscreen", not current_state)
1387
1388 # Bind Escape key to exit full-screen mode
1389 root.bind("<Escape>", toggle_full_screen)
1390
1391 # ASCII Banner (Ensure spacing is preserved)
1392 # ascii_banner = ''' ___ _ ___
1393 # / __| |_ ___ __ _ ___/ __| __ __ _ _ _
1394 # \__ \ _/ -_) _` / _ \__ \/ _/ _` | ' \
1395 # |___/\__\___\__, \___/___/\__\__,_|_||_|
1396 # |___/ '''
1397
1398 # Add a label for the ASCII banner
1399 # banner_label = tk.Label(root, text=ascii_banner, font=("Courier", 10), fg="#00FF00", bg="#040D12", justify="left",
1400 # anchor="w")
1401 # banner_label.pack(pady=10) # Adjust spacing
1402
1403 # Load the image
1404 response = requests.get("https://raw.githubusercontent.com/LCBOWER33/StegoScan/main/images/StegoScan_dark.png")
1405 response.raise_for_status() # Raise error if failed
1406
1407 image_data = response.content
1408 image = Image.open(io.BytesIO(image_data))
1409 banner_image = image.resize((450, 112), Image.LANCZOS) # Resize to (width, height)
1410 banner_photo = ImageTk.PhotoImage(banner_image)
1411 # Display it in a Label
1412 banner_label = Label(root, image=banner_photo)
1413 banner_label.pack(pady=10)
1414

Callers 1

mainFunction · 0.85

Calls 6

CheckboxGroupClass · 0.85
remove_hintFunction · 0.85
add_hintFunction · 0.85
handle_input_changeFunction · 0.85
add_context_menuFunction · 0.85

Tested by

no test coverage detected