I found a solution. Instead of deriving the vtkPolyLineWidget, I create a new class which is the same with the vtkPolyLineWidget and then modify this class directly. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html