import tkinter as tk
from tkinter import ttk, messagebox


class BasePage(ttk.Frame):
    def __init__(self, parent, tcp_client, title):
        super().__init__(parent)
        self.tcp_client = tcp_client
        self.title = title
        self.create_widgets()

    def create_widgets(self):
        ttk.Label(self, text=self.title, font=('Arial', 14)).pack(pady=10)

    def show_error(self, message):
        messagebox.showerror("错误", message)

    def show_info(self, message):
        messagebox.showinfo("信息", message)