- Removed trailing whitespace and ensured files end with a single newline in cleanup_unused_files.py. - Added fix_trailing_whitespace.py to batch remove trailing whitespace from Python files. - Updated install_dependencies.py to improve dependency installation prompts. - Cleaned up pick_coords.py by removing unnecessary whitespace and improving code readability. - Enhanced region_selector.py by disabling specific pylint checks for better compatibility with third-party libraries. - Improved WPS流程图生成工具.py by cleaning up whitespace and enhancing readability. - Updated __init__.py in typings to remove unnecessary lines. - Modified app.js to adjust default configuration values and clean up unused code.
37 lines
740 B
Python
37 lines
740 B
Python
"""主窗口组件
|
|
|
|
包含主窗口布局和事件绑定的GUI组件。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Callable
|
|
import tkinter as tk
|
|
from tkinter import ttk
|
|
|
|
|
|
def create_main_window(
|
|
title: str = "抖音福袋挂机 - 可视化控制台",
|
|
geometry: str = "1400x900",
|
|
) -> Any:
|
|
"""创建主窗口。
|
|
|
|
参数:
|
|
title: 窗口标题
|
|
geometry: 窗口尺寸
|
|
|
|
返回:
|
|
root窗口对象
|
|
"""
|
|
# ttkbootstrap 优先(更美观);没装则回退到原生 tkinter
|
|
try:
|
|
import ttkbootstrap as tb
|
|
root = tb.Window(themename="darkly")
|
|
except Exception:
|
|
root = tk.Tk()
|
|
|
|
root.title(title)
|
|
root.geometry(geometry)
|
|
|
|
return root
|