[vtk-developers] Bug: vtkTkRenderWidget.py.

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Wed Oct 31 08:41:30 EST 2001


hi,

I found a bug that I'm having difficulty figuring out thanks to my
inadequate knowledge of Tcl/Tk and the intricacies of Tkinter.  Here
is a tiny python script that will raise a TclError.

#--------------------------------------------------
import Tkinter, vtkpython, vtkRenderWidget

def test():
    r = Tkinter.Tk()    
    tkw = vtkRenderWidget.vtkTkRenderWidget(r)

if __name__ == '__main__':
    r = Tkinter.Tk()    
    r.withdraw()
    test()
    # comment out the next test function and everything works.
    test()
    r.mainloop()
#--------------------------------------------------

Here is the error I get.

#--------------------------------------------------
$ python tkbug.py 
Traceback (most recent call last):
  File "tkbug.py", line 12, in ?
    test()
  File "tkbug.py", line 5, in test
    tkw = vtkRenderWidget.vtkTkRenderWidget(r)
  File "/skratch/prabhu/vtk/cvs/VTK/Wrapping/Python/vtkTkRenderWidget.py", line 80, in __init__
    Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw)
  File "/usr/local/lib/python2.1/lib-tk/Tkinter.py", line 1756, in __init__
    self.tk.call(
TclError: invalid command name "vtkTkRenderWidget"
#--------------------------------------------------
      
it fails as soon as the second test() is called.  I looked at the
code, and can't figure out why this happens.  It seems that only the
first tkapp object is able to load the vtkTkRenderWidget?!

Thanks,
prabhu

-- 
Prabhu Ramachandran			  MayaVi Data Visualizer
http://www.aero.iitm.ernet.in/~prabhu     http://mayavi.sf.net

Where there's no emotion, there's no motive for violence.
		-- Spock, "Dagger of the Mind", stardate 2715.1



More information about the vtk-developers mailing list