Files
douyin_guaji-main/gui/components/main_window.py
T
Your Name efe6e2252f feat: Add logging and error handling enhancements
- Introduced new logging modules for action tracking, error logging, and performance tracking to improve observability.
- Added functions for retrieving debug and error log paths in `path_config.py`.
- Updated various components to utilize the new logging system, enhancing error handling and performance diagnostics.
- Implemented a GUI component for viewing error logs, improving user experience in monitoring application issues.
- Cleaned up unnecessary blank lines and improved code readability across multiple files.
2025-12-29 20:48:09 +08:00

52 lines
755 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