Home Download Buy Blog Forum Support

how to disable some menu items

how to disable some menu items

Postby fk424 on Tue Sep 11, 2012 10:05 am

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
fk424
 
Posts: 1
Joined: Tue Sep 11, 2012 10:01 am

Re: how to disable some menu items

Postby dbachrach on Tue Sep 11, 2012 4:48 pm

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
dbachrach
 
Posts: 4
Joined: Wed Jan 25, 2012 9:49 pm


Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests