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.

35 lines
1.2 KiB

6 months ago
import tkinter as tk
from tkinter import messagebox
6 months ago
from 家居信息 import JiaJuPage
6 months ago
class MainPage:
def __init__(self, master):
self.root = master
self.page = tk.Frame(self.root)
self.page.pack()
self.root.geometry('600x400')
self.create_page()
def create_page(self):
# 创建一个标签用于展示简单的家居信息标题
6 months ago
self.home_info_title = tk.Label(self.page, text="主页面区", font=("Helvetica", 16))
6 months ago
self.home_info_title.pack(pady=20)
6 months ago
# 添加一个按钮用于跳转到家居信息页面
self.goto_jiaju_button = tk.Button(self.page, text="家居信息", command=self.show_jiaju_info)
self.goto_jiaju_button.pack(pady=10)
def show_jiaju_info(self):
6 months ago
# 销毁当前页面
self.page.destroy()
6 months ago
# 显示家居信息页面
6 months ago
JiaJuInfoPage(self.root)
6 months ago
class JiaJuInfoPage:
def __init__(self, master):
self.root = master
self.page = tk.Frame(self.root)
self.page.pack()
self.root.geometry('600x400')
JiaJuPage(self.root)
6 months ago
if __name__ == '__main__':
root = tk.Tk()
app = MainPage(root)
root.mainloop()