class initface(): def __init__(self,master): self.master = master self.master.config(bg='white') self.initface = tk.Frame(self.master,) self.initface.pack() # 左边:按钮区域,创建一个容器 self.Pane_top = tk.PanedWindow(width=900, height=100, background="white") self.Pane_top.place(x=0, y=0) self.Pane_left = tk.PanedWindow(width=210, height=540, background="grey") self.Pane_left.place(x=0, y=94) self.Pane_right = tk.PanedWindow(width=690, height=540, background="white") self.Pane_right.place(x=210, y=94) self.bg_photo = tk.PhotoImage(file='manager.gif') img_label = tk.Label(self.Pane_top, image=self.bg_photo, width=900, height=120) img_label.place(x=0, y=0) img_label.pack() # 添加左边按钮 self.btn = tk.Button(self.Pane_top, text='退出', width=6, font=("华文黑体", 10, "bold"), command=self.change) self.btn.place(x=830, y=4) self.LabelFrame_operate = tk.LabelFrame(self.Pane_left, text="操作窗口", width=200, height=200) self.LabelFrame_operate.place(x=5, y=0) self.Button_add = tk.Button(self.LabelFrame_operate, text="添加学生", width=10, font=("华文黑体", 15, "bold"), command=self.addstudent) self.Button_add.place(x=40, y=20) self.Button_update = tk.Button(self.LabelFrame_operate, text="加入学会", width=10, font=("华文黑体", 15, "bold"), command=self.add_union) self.Button_update.place(x=40, y=80) self.Button_delete = tk.Button(self.LabelFrame_operate, text="删除学生", width=10, font=("华文黑体", 15, "bold"), command=self.delete_student) self.Button_delete.place(x=40, y=140) self.LabelFrame_delete = tk.LabelFrame(self.Pane_left, text="学生删除窗口,输入需删除学生\n学号后请点击\n‘删除学生'按钮进行操作’", width=200, height=340) self.LabelFrame_delete.place(x=5,y=200) self.Label_delete_sno = tk.Label(self.LabelFrame_delete, text="学号:") self.Label_delete_sno.place(x=10, y=30) self.Entry_delete_sno = tk.Entry(self.LabelFrame_delete, width=8) self.Entry_delete_sno.place(x=45, y=30) # self.Label_delete_name = tk.Label(self.LabelFrame_delete, text="姓名:") # self.Label_delete_name.place(x=10, y=80) # self.Entry_delete_name = tk.Entry(self.LabelFrame_delete, width=8) # self.Entry_delete_name.place(x=45, y=80)
时间: 2024-04-29 19:20:20 浏览: 220
Python RuntimeError: thread.__init__() not called解决方法
这是一个 Python 类的初始化方法,该类创建了一个图形用户界面(GUI)窗口。在这个窗口里,有一个顶部的按钮区域和一个左侧的操作窗口,以及一个右侧的空白区域。在左侧操作窗口中,有三个按钮,分别用于添加学生、加入学会和删除学生。在删除学生区域中,有一个文本框用于输入要删除的学生的学号。整个 GUI 界面的布局和样式都是使用 tkinter 库实现的。
阅读全文