-1

This is the code snippet I use to create a menu in tkinter.

        self.fileMenu = Menu(self.menu)
        self.fileMenu.add_cascade(label="Open...", menu=openMenu)
        self.fileMenu.add_cascade(label="Save...") 
        self.fileMenu.add_command(label="Reset", command=self.model.reset)
        self.fileMenu.add_separator()
        self.fileMenu.add_command(label="Exit", state='disabled') 

At a point in my program I want to disable this menu (or its items), then display a messageBox and finally re-instate the menu.

I know that I can do each item individually with self.fileMenu.entryconfig("Open...", state='disabled').

How do I do it for all, without disabling each option individually?

user2302244
  • 843
  • 2
  • 11
  • 27
  • Does this answer your question? [tkinter enable/disable menu](https://stackoverflow.com/questions/23442792/tkinter-enable-disable-menu) – Ben the Coder Mar 17 '23 at 14:24

1 Answers1

0

How do I do it for all, without disabling each option individually?

You can't do them all with a single command. You have to do each one individually. You can, of course, create your own function that does each one individually. Then you can call the function once to reconfigure them all.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685