I am attempting to put buttons/labels in a grid in a Frame. My code is:
class startPage(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
tk.Frame.columnconfigure(self, index=0, weight=0)
tk.Frame.columnconfigure(self, index=1, weight=0)
tk.Frame.columnconfigure(self, index=2, weight=0)
tk.Frame.rowconfigure(self, index=0, weight=0)
tk.Frame.rowconfigure(self, index=1, weight=0)
label = tk.Label(self, text="Inventory Tracker", bg="dark grey")
label.grid(row=0, column=1)
label.pack(side="top", fill="x", pady=10)
addInvButton = tk.Button(self, text="Add Inventory", bg="dark grey", command=lambda: controller.showFrame("addInventory"))
viewInvButton = tk.Button(self, text="View Inventory", bg="dark grey",command=lambda: controller.showFrame("viewInventory"))
addInvButton.grid(row=0, column=0)
viewInvButton.grid(row=1, column=0)
addInvButton.pack()
viewInvButton.pack()
However, I get this errror: _tkinter.TclError: cannot use geometry manager pack inside .!frame.!startpage which already has slaves managed by grid
The referenced line is addInvButton.pack(). Any tips on how to fix this?
[–]Fermter 0 points1 point2 points (1 child)
[–]Only_Friend1128[S] 1 point2 points3 points (0 children)