Hi,
I'm trying to add an option to the Window menu item and disable the other items (except for the Console) in that same menu.
The method used is:
def build_window_menu(self):
return ('Window', [
('Default Size', self.amethodthatworks),
('_', None),
('Full Screen', self.noactionmethod, '`', lambda: commands.DisabledMenuState),
('Fit', self.noactionmethod, 'W', lambda: commands.DisabledMenuState),
('Center', self.noactionmethod, None , lambda: commands.DisabledMenuState),
('Center Fit', self.noactionmethod, 'shift+W' , lambda: commands.DisabledMenuState),
])
The new option ('Default Size') is added and the method ( self.amethodthatworks ) is launched when clicking on the item.
But the other options do not seem to be affected at all:
* the items are not disabled
* and their method (self.noactionmethod) which is meant to do nothing and suppress the event is not picked up. Instead their default behaviour is followed.
So I would like to ask: is it actually possible to update these menu items? Is there something wrong with the menu list above (similar lists seem to work for other menus)? Is there a known event at which the Window menu is redrawn (and commands.defineModeMenu needs to be called again to override items) but the other menus are not?
Thanks,
Aris