change tk
This commit is contained in:
43
main_tkinter.py
Normal file
43
main_tkinter.py
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Linux 存储管理工具 - Tkinter 版本
|
||||
适配低版本系统(如 CentOS 8)
|
||||
"""
|
||||
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
import sys
|
||||
import os
|
||||
|
||||
# 将当前目录添加到路径
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from mainwindow_tkinter import MainWindow
|
||||
|
||||
|
||||
def main():
|
||||
"""主程序入口"""
|
||||
root = tk.Tk()
|
||||
root.title("Linux 存储管理工具")
|
||||
root.geometry("1200x800")
|
||||
|
||||
# 设置最小窗口大小
|
||||
root.minsize(800, 600)
|
||||
|
||||
# 尝试设置 DPI 感知(仅在 Windows 上有效)
|
||||
try:
|
||||
from ctypes import windll
|
||||
windll.shcore.SetProcessDpiAwareness(1)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# 创建应用
|
||||
app = MainWindow(root)
|
||||
|
||||
# 运行主循环
|
||||
root.mainloop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user