Add toggle item to context menu

I can add an item to a context menu by following the customContextMenu.C tutorial.
For example, I have a simple macro (attached) which draws 4 canvases and allows me to toggle the fill color between black and white individually for each canvas using an added item on the context menu. However, I cannot find a way of making this a toggle item (ie showing the state with a tick). I wonder if this possible in a simple macro, or must it be done in a derived class using member functions?
AddToggleToContext.C (1.4 KB)


This is weird. I’ll check.

Cheers, Bertrand.

So sorry, but it’s not possible to add toggle functions to context menus (beside class methods)

Cheers, Bertrand.

Hi Bertrand,
Thanks for looking into it. I’ll just have to do without.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.