|
|
|
|
import tkinter
|
|
|
|
|
from tkinter import *
|
|
|
|
|
from tkinter.ttk import Style
|
|
|
|
|
|
|
|
|
|
import ttkbootstrap as ttk
|
|
|
|
|
from ttkbootstrap.constants import *
|
|
|
|
|
|
|
|
|
|
import MainPages
|
|
|
|
|
import tkinter.messagebox as mb
|
|
|
|
|
|
|
|
|
|
def callback():
|
|
|
|
|
if mb.askokcancel("退出系统", "你确定要退出系统吗?"):
|
|
|
|
|
root.destroy()
|
|
|
|
|
#想要切换主题,修改theme值即可,有以下这么多的主题,自己尝试吧:['vista', 'classic', 'cyborg', 'journal',
|
|
|
|
|
# 'darkly', 'flatly', 'clam', 'alt', 'solar', 'minty', 'litera', 'united', 'xpnative',
|
|
|
|
|
# 'pulse', 'cosmo', 'lumen', 'yeti', 'superhero', 'winnative', 'sandstone', 'default']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
root = ttk.Window(title="窗口名字", #设置窗口的标题
|
|
|
|
|
themename="flatly", #设置主题
|
|
|
|
|
size=(2066,600), #窗口的大小
|
|
|
|
|
position=(100,100), #窗口所在的位置
|
|
|
|
|
minsize=(0,0), #窗口的最小宽高
|
|
|
|
|
maxsize=(1920,1080), #窗口的最大宽高
|
|
|
|
|
resizable=None, #设置窗口是否可以更改大小
|
|
|
|
|
alpha=1.0, )
|
|
|
|
|
root.title('教务管理系统')
|
|
|
|
|
root.protocol("WM_DELETE_WINDOW", callback)
|
|
|
|
|
MainPages.LoginPage(root)
|
|
|
|
|
|
|
|
|
|
root.mainloop()
|