How can I programatically disable (and enable again) the right-click context menu in slice views?
You can configure this at multiple levels. If you just want to disable all actions in all views then you can set an empty list for the allowed context menu action names. If you just want to disable right-click action in certain views then you can remove the right-click GUI event translation (assign the right-click GUI event to
vtk.vtkWidgetEvent.NoEvent widget event).