0

I have this following menu created in Tkinter

subMenu = Menu(Selection)
Selection.add_cascade(label = "Maze Generation Algorithms", menu = subMenu)
subMenu.add_command(label = "Recursive Back Tracking", command = FindNext(Stack[0], Stack, canvas, root))

The problem is when I start up my program, the FindNext function will automatically run without the menu button being pressed yet. How would I fix this?

Chris A
  • 19
  • 3

1 Answers1

0

Try to use lambda


subMenu.add_command(label = "Recursive Back Tracking", command = lambda:FindNext(Stack[0], Stack, canvas, root))
JacksonPro
  • 3,135
  • 2
  • 6
  • 29
poptick
  • 1
  • 2