因此,我创建的所有帧都想放入labelframe(self.mlb = LabelFrame)内,尽管除了其中一个以外,其余都不在其中,我做错了什么。谢谢
from Tkinter import *
class STproject:
def __init__(self,app): #1
self.mlb=LabelFrame(app,text='Movie Recommendation Engine',height=400,width=400).grid(sticky=W+E+N+S)
self.lframe1=LabelFrame(self.mlb,text="Engine",background='yellow',height=100,width=100).grid(row=0,column=0)
self.lframe2=LabelFrame(self.mlb,text="Similarity",background='purple',height=100,width=100).grid(row=1,column=0)
self.framebutton=Frame(self.mlb,background='pink',height=100,width=100).grid(row=2,column=0)
self.frame3=Frame(self.mlb,background='red',height=200,width=200).grid(row=0,column=1,rowspan=3)
self.frame4=Frame(self.mlb,background='green',height=200,width=200).grid(row=0,column=2,rowspan=3)
self.frame5=Frame(self.mlb,background='blue',height=200,width=200).grid(row=0,column=3,rowspan=3)
root=Tk()
root.title('SteelBox Inc. Calculator')
application=STproject(root) #2
root.mainloop() #3