From 163d4fdcf7139774f49324142be605ee545001bf Mon Sep 17 00:00:00 2001 From: hck <2243793431@qq.com> Date: Tue, 28 May 2024 20:16:55 +0800 Subject: [PATCH] first commit --- MinaPage.py | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 MinaPage.py diff --git a/MinaPage.py b/MinaPage.py new file mode 100644 index 0000000..d7be46a --- /dev/null +++ b/MinaPage.py @@ -0,0 +1,72 @@ +import tkinter as tk +from views import AboutFrame,ChangeFrame,SearchFrame,InsertFrame,DeleteFrame + + +class MianPage: + def __init__(self,master): + self.root = master + self.root.title("学生信息管理系统") + self.root.geometry('600x400') + self.create_page() + def create_page(self): + self.about_frame = AboutFrame(self.root) + self.insert_frame = InsertFrame(self.root) + self.search_frame = SearchFrame(self.root) + self.change_frame = ChangeFrame(self.root) + self.delete_frame = DeleteFrame(self.root) + + + menubar = tk.Menu(self.root) + menubar.add_command(label='录入',command=self.show_insert) + menubar.add_command(label='查询',command=self.show_search) + menubar.add_command(label='删除',command=self.show_delete) + menubar.add_command(label='修改',command=self.show_change) + menubar.add_command(label='关于',command=self.show_about) + self.root['menu'] = menubar + + def show_insert(self): + self.about_frame.pack_forget() + self.insert_frame.pack() + self.search_frame.pack_forget() + self.change_frame.pack_forget() + self.delete_frame.pack_forget() + + def show_search(self): + self.about_frame.pack_forget() + self.insert_frame.pack_forget() + self.search_frame.pack() + self.change_frame.pack_forget() + self.delete_frame.pack_forget() + + def show_delete(self): + self.about_frame.pack_forget() + self.insert_frame.pack_forget() + self.search_frame.pack_forget() + self.change_frame.pack_forget() + self.delete_frame.pack() + def show_change(self): + self.about_frame.pack_forget() + self.insert_frame.pack_forget() + self.search_frame.pack_forget() + self.change_frame.pack() + self.delete_frame.pack_forget() + + def show_about(self): + self.about_frame.pack() + self.insert_frame.pack_forget() + self.search_frame.pack_forget() + self.change_frame.pack_forget() + self.delete_frame.pack_forget() + + + + + + + + + +if __name__ == '__main__': + root = tk.Tk() + MianPage(root) + root.mainloop()