Hello,
I am looking to implement a context menu similar to this one from the script repository - however, I’d like to be able to use a right click instead of a left click with the mouse.
I know that I can do something like the below to create a menu when I right click, but this allows the menu to pop up even if a markup fiducial is not clicked, and doesn’t allow me to pass the fiducial ID through the callData to update the menu accordingly.
layoutManager = slicer.app.layoutManager()
redRenderWindow = layoutManager.sliceWidget('Red').sliceView().renderWindow()
style = vtk.vtkInteractorStyleUser()
redRenderWindow.GetInteractor().SetInteractorStyle(style)
style.AddObserver(vtk.vtkCallbackCommand.RightButtonPressEvent, self.analysisWidget.markupCallback)