You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

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()