Sublime Forum

How to disable some menu items

#1

I want to check the file status, then disable some menu or enable some menu.
how to do?

just like “show unsaved change”.
when no change, the menu item is disabled

0 Likes

#2

You can disable the menu item pragmatically in your WindowCommand sublcass like this:

class MyMenuCommand(sublime_plugin.WindowCommand):
def is_enabled(self):
return False # or True

0 Likes