fix: 设置窗口标题栏图标并将其打包进可执行文件
This commit is contained in:
@@ -19,6 +19,18 @@ class BatchTableExtractorApp:
|
||||
self.root.title("WordTableExtractor")
|
||||
self.root.geometry("640x520")
|
||||
self.root.minsize(580, 460)
|
||||
|
||||
# 尝试设置窗口图标
|
||||
try:
|
||||
import sys
|
||||
if getattr(sys, 'frozen', False):
|
||||
icon_path = os.path.join(sys._MEIPASS, "app.ico")
|
||||
else:
|
||||
icon_path = os.path.join(APP_DIR, "app.ico")
|
||||
if os.path.exists(icon_path):
|
||||
self.root.iconbitmap(icon_path)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# 状态变量
|
||||
self.mode_var = tk.StringVar(value="dir") # "file" 或 "dir"
|
||||
|
||||
Reference in New Issue
Block a user