按钮摆放位置换位place之后就无法显示了
from tkinter import *class App():
def __init__(self, master):
self.root = master#定义内部变量root
#self.root.config()
self.root.title('1611班学生信息管理系统')
self.root.geometry('%dx%d' % (600, 400))# 设置窗口大小
choice(self.root)
class choice():
def __init__(self, master):
self.master = master
#self.master.config(bg='green')
# 基准界面choice
self.choice = Frame(self.master )
self.choice.pack()
btn1 = Button(self.choice, text = '教师')
btn1.place(x = 400,y = 200)
if __name__ == '__main__':
root = Tk()
App(root)
root.mainloop()
from tkinter import *
class App:
def __init__(self, master):
self.root = master# 定义内部变量root
# self.root.config()
self.root.title('1611班学生信息管理系统')
self.root.geometry('%dx%d' % (600, 400))# 设置窗口大小
choice(self.root)
class choice:
def __init__(self, master):
self.master = master
# self.master.config(bg='green')
# 基准界面 choice
self.choice = Frame(self.master, width=600, height=400)
btn1 = Button(self.choice, text='教师')
btn1.place(x=400, y=200)
self.choice.pack()
if __name__ == '__main__':
root = Tk()
App(root)
root.mainloop()
页:
[1]