I want to use grid to position frames in root, and use pack to position button in first frame. The master window is different, so why do I get this error?
root = Tk()
frame1 = LabelFrame(root, text="Frame1").grid(row=0, column=0)
frame2 = LabelFrame(root, text="Frame2").grid(row=0, column=1)
def open_file():
pass
btn_import_image = Button(frame1, text="Import", command=open_file)
btn_import_image.pack()
root.mainloop()
Error:
_tkinter.TclError: cannot use geometry manager pack inside . which already has slaves managed by grid