我只是想创建一个简单的下拉菜单,并在单击一个命令时将您引导到特定的框架。我知道我做错了什么,但我不知道它是什么。任何人都可以指导我或给我一个例子吗?
# Redirects to a specific frame
def GoFrame(goFrameNow):
FAQ.grid_forget()
GoFrameNow.grid()
# Core knowledge content and design after login successfull (myGUI being main root)
def Core():
myGUI.withdraw()
NewRoot = Toplevel(myGUI,
bg="powderblue")
NewRoot.geometry('800x500')
NewRoot.resizable(width=False, height=False)
# DropDown Menu being created
mainMenu = Menu(NewRoot)
NewRoot.config(menu=mainMenu)
CoreContentMenu = Menu(mainMenu)
mainMenu.add_cascade(label="Support", menu=CoreContentMenu)
CoreContentMenu.add_command=Label("FAQ", command=lambda: GoFrame(FAQ))
# Creates FAQ frame to test
FAQ = Frame(Core)
Label(FAQ, text="Testing").grid(row=0, column=0, columnspan=2)