How to forbidden left and right mouse event on vtkMRMLMarkupsLineNode

i made a line node like the picture
image
and i want the line node to not react on mouse left and mouse right event
how to do it in the C++ or python Code?

You can lock the markups node to prevent interaction.

From the Markups module:

image

From Python/C++:

getNode("MarkupsLine").SetLocked(True)

thank you ,it’s very useful for me