[vtkusers] Problems with vtkTkRenderWidget and vtkSplineWidget

Heikki Uuksulainen heuuksul at cc.jyu.fi
Tue Feb 3 11:15:13 EST 2004


Hello VTK users.

I am trying to use vtkSplineWidget with vtkTkRenderWidget but there is
few things that I don't understand. The code is (more or less) simply this
(Python):

        tkw = vtkRenderWidget.vtkTkRenderWidget
               (self.canvas,width=250,height=300)

        self.tkwidget = tkw
	self.tkwidget.pack (expand='true',fill='both')

	self.ren = ren = vtkpython.vtkRenderer ()
	self.renWin = renWin = self.tkwidget.GetRenderWindow ()
	self.renWin.AddRenderer (self.ren)

        iren = renWin.GetInteractor()

        self.sw = sw = vtk.vtkSplineWidget()
        sw.SetInteractor(iren)
        sw.On()


I get this error message:

ERROR: In /home/heuuksul/vtk/VTK/Hybrid/vtkSplineWidget.cxx, line 382
vtkSplineWidget (0x84ecdf8): The interactor must be set prior to
enabling/disabling widget

It seems to be that the interactor got from the vtkTkRenderWidget is NULL.
Why is that? And what should I do with this? All the examples I found
worked that way. I don't want to create new
vtkRenderWindow (that works fine), instead use the Tk window (or canvas).

Is it possible to do that? I think it is...

Thanks in advance!


-Heikki Uuksulainen-



More information about the vtkusers mailing list