Add contextMenu item in general plugin

Hi is possible to add an item to the right click menu in General Plugin?

I want to add an item that can be toggled like:

imagen

In the past in a Reporter Plugin I used conditionalContextMenus but didn’t worked for me this time.

Any reference or help is appreciated.

Best!

You need to add any callback (that you most likely already have) and then implement:

- (void)addMenuItemsForEvent:(NSEvent *)theEvent controller:(NSViewController<GSGlyphEditViewControllerProtocol>*)controller toMenu:(NSMenu *)theMenu;

or

def addMenuItemsForEvent_controller_toMenu_(theEvent, controller, theMenu)